shellfie 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +46 -9
  2. package/package.json +1 -1
  3. package/shellfie.js +0 -1
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # shellfie 🤳🏽
2
2
 
3
- create beautiful terminal screenshots programmatically
3
+ <img src="./shellfies/logo.png" />
4
4
 
5
5
  # install
6
6
  ```bash
7
- yarn add shellfie
7
+ npm install shellfie
8
8
  ```
9
9
 
10
10
  # the holy trinity ▽
11
- `shellfie` respects the holy trinity: the lib, the service, and the cli.
11
+ `shellfie` respects the holy trinity: the lib, the service, and the holy cli.
12
12
  - [shellfie](https://github.com/tool3/shellfie)
13
13
  - [shellfied](https://github.com/tool3/shellfied)
14
14
  - [shellfie-cli](https://github.com/tool3/shellfie-cli)
15
15
 
16
16
  # usage
17
- ```js
17
+ ```javascript
18
18
  const data = [
19
19
  '\x1b[105mSHELLFIE\\x1b[0m🤳',
20
20
  '\x1b[38;5;225mthe easiest way',
@@ -95,15 +95,15 @@ outputs:
95
95
  **type**: `number`
96
96
  **description**: viewport height
97
97
 
98
- # examples
99
- ```js
100
- await shellfie(["\x1b[32mGreen line", "\x1b[31;1mRED bold"], { name: 'small', viewport: { width: 200, height: 200 } });
101
- ```
98
+ # examples
99
+ ```javascript
100
+ await shellfie(["\x1b[32mGreen line", "\x1b[31;1mRED bold"], { name: 'small', viewport: { width: 200, height: 200 } });
101
+ ```
102
102
 
103
103
  <img src="./shellfies/small.png" />
104
104
 
105
105
 
106
- ```js
106
+ ```javascript
107
107
  const testResults = [
108
108
  "yarn run v1.22.5",
109
109
  "$ mocha --no-timeouts tests/ --colors",
@@ -129,6 +129,43 @@ const testResults = [
129
129
  "Done in 19.60s.",
130
130
  ];
131
131
  await shellfie(testResults, { name: 'fira', style: { fontFamily: 'Fira Code', fontWeight: 'bold' } });
132
+ await shellfie(testResults, { name: 'monospace', style: { fontFamily: 'monospace' } });
133
+ await shellfie(testResults, { name: 'monaco', style: { fontFamily: 'Monaco' } });
132
134
  ```
133
135
 
134
136
  <img src="./shellfies/fira.png" />
137
+ <img src="./shellfies/monospace.png" />
138
+ <img src="./shellfies/monaco.png" />
139
+
140
+ ### raw mode
141
+ ```javascript
142
+ const string = `
143
+ cristal ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
144
+ teen ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
145
+ mind ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
146
+ morning ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
147
+ vice ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
148
+ passion ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
149
+ fruit ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
150
+ instagram ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
151
+ atlas ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
152
+ retro ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
153
+ summer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
154
+ pastel ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
155
+ rainbow ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
156
+ `
157
+ await shellfie(string, { name: 'gradient', mode: 'raw', viewport: {width: 600, height: 350} });
158
+ ```
159
+ <img src="./shellfies/gradient.png" />
160
+
161
+ ### bash colors
162
+ ```javascript
163
+ const shellfie = require('shellfie');
164
+ let backgroundColors = '';
165
+ for (let i = 0; i < 255; i++) {
166
+ backgroundColors += `\x1b[48;5;${i}m ${i}\x1b[0m`;
167
+ }
168
+ await shellfie(backgroundColors, { name: 'background', viewport: {width: 500, height: 400} });
169
+ ```
170
+
171
+ <img src="./shellfies/background.png" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shellfie",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "create beautiful terminal screenshots programmatically",
5
5
  "main": "shellfie.js",
6
6
  "directories": {
package/shellfie.js CHANGED
@@ -21,7 +21,6 @@ async function shellfie(data, config) {
21
21
 
22
22
  // inject js scripts
23
23
  const localModules = __dirname + '/node_modules';
24
- console.log(localModules);
25
24
  await page.addScriptTag({ path: require.resolve('xterm/lib/xterm.js') });
26
25
  await page.addScriptTag({ path: require.resolve('xterm-addon-fit/lib/xterm-addon-fit.js') });
27
26