-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathnode.html
More file actions
79 lines (76 loc) · 2.84 KB
/
node.html
File metadata and controls
79 lines (76 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{% for item in include.node %}
<h3>Install from a Node package {{ item.suffix }} (with npm or yarn)</h3>
<p class="alert alert-info">
Make sure you have
<a href="https://www.npmjs.com/get-npm">npm</a>
or <a href="https://yarnpkg.com/en/docs/install">yarn</a>
{% if include.dependencies != nil && include.dependencies != empty && include.dependencies.first != nil %}
{% assign list = include.dependencies | join: ', ' %}
{% if list != '' %}
and all dependencies {{ list }}
{% endif %}
{% endif %}
installed.
</p>
<div class="card mb-3">
<div class="card-body">
{% if true == item.dev %}
Require it as a dev dependency:
{% if true == item.yarn %}
<br/>
<code class="highlighter-rouge">
yarn add --dev
{% for package in item.packages %}
{{ package.name }}{% if package.version != nil %}@{{ package.version }}{% endif %}
{% endfor %}
</code>
{% endif %}
{% if true == item.yarn and true == item.npm %}<br/>or{% endif %}
{% if true == item.npm %}
<br/>
<code class="highlighter-rouge">
npm install --save-dev
{% for package in item.packages %}
{{ package.name }}{% if package.version != nil %}@{{ package.version }}{% endif %}
{% endfor %}
</code>
{% endif %}
{% endif %}
{% if true == item.dev and true == item.global %}<br/>{% endif %}
{% if true == item.global %}
Require it as a global dependency:
{% if true == item.yarn %}
<br/>
<code class="highlighter-rouge">
yarn global add
{% for package in item.packages %}
{{ package.name }}{% if package.version != nil %}@{{ package.version }}{% endif %}
{% endfor %}
</code>
{% endif %}
{% if true == item.yarn and true == item.npm %}<br/>or{% endif %}
{% if true == item.npm %}
<br/>
<code class="highlighter-rouge">
npm install --global
{% for package in item.packages %}
{{ package.name }}{% if package.version != nil %}@{{ package.version }}{% endif %}
{% endfor %}
</code>
{% endif %}
{% endif %}
{% if item.commands %}
{% for command in item.commands %}
<br/>{{ command.description }}:
{% if true == item.yarn %}
<br/><code class="highlighter-rouge">yarn run {{ command.executable }} {{ command.arguments }}</code>
{% endif %}
{% if true == item.yarn and true == item.npm %}<br/>or{% endif %}
{% if true == item.npm %}
<br/><code class="highlighter-rouge">npm run {{ command.executable }} -- {{ command.arguments }}</code>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endfor %}