├── .gitignore
├── front-end-cheat-sheet.jpg
├── pdf
└── front-end-cheat-sheet.pdf
├── README.md
├── css
└── style.css
└── html
└── front-end-cheat-sheet.html
/.gitignore:
--------------------------------------------------------------------------------
1 | .sass-cache
2 | node_modules
3 | .DS_Store
4 |
5 |
--------------------------------------------------------------------------------
/front-end-cheat-sheet.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/markusfalk/front-end-cheatsheet/HEAD/front-end-cheat-sheet.jpg
--------------------------------------------------------------------------------
/pdf/front-end-cheat-sheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/markusfalk/front-end-cheatsheet/HEAD/pdf/front-end-cheat-sheet.pdf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # front-end-cheatsheet
2 |
3 | A cheat sheet with common commands and reminders for
4 |
5 | * Node
6 | * Angular CLI
7 | * Jasmine
8 | * semver
9 |
10 | [
](https://github.com/markusfalk/front-end-cheatsheet/blob/master/pdf/front-end-cheat-sheet.pdf?raw=true)
11 |
12 | * [Download PDF](https://github.com/markusfalk/front-end-cheatsheet/blob/master/pdf/front-end-cheat-sheet.pdf?raw=true)
13 |
14 |
--------------------------------------------------------------------------------
/css/style.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | color: #333;
4 | font-family: Helvetica Neue, Helvetica, Arial, FreeSans, sans-serif;
5 | padding: 0;
6 | }
7 |
8 | pre,
9 | code {
10 | background-color: #222;
11 | color: #fff;
12 | padding: 5px;
13 | white-space: pre;
14 | white-space: pre-wrap;
15 | word-break: break-all;
16 | word-wrap: break-word;
17 | -moz-border-radius: 5px;
18 | -webkit-border-radius: 5px;
19 | border-radius: 5px;
20 | line-height: 2;
21 | margin: 0 0 15px 0;
22 | font-size: 12px;
23 | }
24 |
25 | h1 {
26 | margin: 0;
27 | }
28 |
29 | h2 {
30 | margin: 5px 0;
31 | font-size: 22px;
32 | }
33 |
34 | h3 {
35 | color: #222;
36 | font-weight: normal;
37 | font-size: 14px;
38 | margin: 0 0 10px 0;
39 | }
40 |
41 | table {
42 | border-collapse: collapse;
43 | margin: 20px 0;
44 | }
45 |
46 | th,
47 | td {
48 | text-align: left;
49 | border: 1px solid silver;
50 | padding: 5px;
51 | font-size: 12px;
52 | }
53 |
54 | section {
55 | float: left;
56 | height: 800px;
57 | width: 24%;
58 | padding: 0 0.5%;
59 | }
60 |
61 | div {
62 | margin-bottom: 25px;
63 | }
64 |
65 | ul {
66 | padding-left: 20px;
67 | margin: 0 0 5px 0;
68 | }
69 |
70 | li {
71 | font-size: 14px;
72 | line-height: 1.6;
73 | }
74 |
75 | a {
76 | color: steelblue;
77 | }
78 |
79 | .meta h2,
80 | li {
81 | font-size: 12px;
82 | }
83 |
84 | .node h2 {
85 | color: #cc3d33;
86 | }
87 | .node code,
88 | .node pre {
89 | background-color: #cc3d33;
90 | }
91 |
92 | .angular h2 {
93 | color: rgb(25,118,210);
94 | }
95 | .angular code,
96 | .angular pre {
97 | background-color: rgb(25,118,210);
98 | }
99 |
100 | .jasmine h2 {
101 | color: #8a4182;
102 | }
103 | .jasmine code,
104 | .jasmine pre {
105 | background-color: #8a4182;
106 | }
107 |
108 | .jasmine code strong {
109 | color: yellow;
110 | }
111 |
112 | .bower h2 {
113 | color: #543729;
114 | }
115 | .bower code,
116 | .bower pre {
117 | background-color: #543729;
118 | }
119 |
--------------------------------------------------------------------------------
/html/front-end-cheat-sheet.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | front-end-cheat-sheet
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Node
16 |
17 |
Search the registry for package
18 |
npm s <search term>
19 |
20 |
Install package and save it to package.json
21 |
npm i [-g] <package-name>[@semver] [--save[-dev]]
22 |
23 |
Show version(s) of package
24 |
npm v <package-name> [--version[s]]
25 |
26 |
Uninstall packages
27 |
npm rm <package-name>
28 |
29 |
List packages
30 |
npm ls [<package-name>] --depth=0
31 |
32 |
Go to documentation page of package
33 |
npm docs <package-name>
34 |
35 |
Go to issue page of package
36 |
npm bugs <package-name>
37 |
38 |
List outdated packages
39 |
npm outdated [-g]
40 |
41 |
42 |
43 |
44 |
45 |
46 |
Angular 2 CLI
47 |
48 |
Generate Component
49 |
ng g component <name>
50 |
51 |
Generate Directive
52 |
ng g directive <name>
53 |
54 |
Generate Pipe
55 |
ng g pipe <name>
56 |
57 |
Generate Service
58 |
ng g service <name>
59 |
60 |
Generate Class
61 |
ng g class <name>
62 |
63 |
Generate Interface
64 |
ng g interface <name>
65 |
66 |
68 |
69 |
Run application in local server
70 |
ng serve
71 |
72 |
Creating a build and change environment
73 |
ng build [--e=<name>]
74 |
75 |
Testing your application
76 |
ng test | e2e
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
Jasmine
85 |
86 |
Matchers
87 |
expect(array).toContain(member);
expect(fn).toThrow(string);
expect(fn).toThrowError(string);
expect(instance).toBe(instance);
expect(mixed).toBeDefined();
expect(mixed).toBeFalsy();
expect(mixed).toBeNull();
expect(mixed).toBeTruthy();
expect(mixed).toBeUndefined();
expect(mixed).toEqual(mixed);
expect(mixed).toMatch(pattern);
expect(num).toBeGreaterThan(num);
expect(num).toBeLessThan(num);
88 |
93 |
94 |
Syntax
95 |
describe("A suite", () => {
96 | beforeEach(() => {
97 | });
98 | afterEach(() => {
99 | });
100 | it("an assertion", () => {
101 | expect(true).toBe(true);
102 | });
103 | });
104 |
105 |
106 |
107 |
108 |
109 |
110 |
Semantic Versioning
111 |
112 | - major: incompatible API changes
113 | - minor: backwards-compatible functionality
114 | - patch: backwards-compatible bug fixes
115 |
116 |
117 |
118 |
119 | | Version |
120 | Explanation |
121 |
122 |
123 |
124 |
125 | | 1.2.3 |
126 | A specific version |
127 |
128 |
129 | | >1.2.3 |
130 | Greater than a specific version |
131 |
132 |
133 | | <1.2.3 |
134 | Less than a specific version |
135 |
136 |
137 | | >=1.2.3 |
138 | Greater than or equal to |
139 |
140 |
141 | | <=1.2.3 |
142 | Less than or equal to |
143 |
144 |
145 | | ~1.2.3 |
146 | (>=1.2.3 <1.3.0) close to 1.2.3 |
147 |
148 |
149 | | ~1.2 |
150 | (>=1.2.0-0 <1.3.0-0) any version starting with 1.2 |
151 |
152 |
153 | | ^1.2.3 |
154 | (>=1.2.3 <2.0.0) compatible with 1.2.3 |
155 |
156 |
157 | | ^0.1.3 |
158 | (0.1.3) 0.x.x = unstable |
159 |
160 |
161 | | ^1.2 |
162 | (>=1.2.0-0 <2.0.0-0) any version compatible with 1.2 |
163 |
164 |
165 |
166 |
167 | | * |
168 | any version |
169 |
170 |
171 |
172 |
173 |
174 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
--------------------------------------------------------------------------------