@jvittechs/jai1-cli 0.1.97 → 0.1.99
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.
- package/dist/cli.js +5 -5
- package/dist/cli.js.map +1 -1
- package/dist/web-chat/index.html +1 -0
- package/dist/web-chat/style.css +20 -0
- package/package.json +1 -1
- package/dist/web-chat/node_modules/.bin/0ecdsa-generate-keypair +0 -15
- package/dist/web-chat/node_modules/.bin/0gentesthtml +0 -89
- package/dist/web-chat/node_modules/.bin/0serve +0 -97
- package/dist/web-chat/node_modules/.bin/acorn +0 -4
- package/dist/web-chat/node_modules/.bin/autoprefixer +0 -22
- package/dist/web-chat/node_modules/.bin/baseline-browser-mapping +0 -2
- package/dist/web-chat/node_modules/.bin/browserslist +0 -156
- package/dist/web-chat/node_modules/.bin/esbuild +0 -0
- package/dist/web-chat/node_modules/.bin/jiti +0 -34
- package/dist/web-chat/node_modules/.bin/js-yaml +0 -126
- package/dist/web-chat/node_modules/.bin/jsesc +0 -148
- package/dist/web-chat/node_modules/.bin/json5 +0 -152
- package/dist/web-chat/node_modules/.bin/katex +0 -112
- package/dist/web-chat/node_modules/.bin/loose-envify +0 -16
- package/dist/web-chat/node_modules/.bin/lz-string +0 -13
- package/dist/web-chat/node_modules/.bin/nanoid +0 -55
- package/dist/web-chat/node_modules/.bin/parser +0 -15
- package/dist/web-chat/node_modules/.bin/prebuild-install +0 -78
- package/dist/web-chat/node_modules/.bin/rc +0 -4
- package/dist/web-chat/node_modules/.bin/rollup +0 -1912
- package/dist/web-chat/node_modules/.bin/semver +0 -174
- package/dist/web-chat/node_modules/.bin/tsc +0 -2
- package/dist/web-chat/node_modules/.bin/tsserver +0 -2
- package/dist/web-chat/node_modules/.bin/update-browserslist-db +0 -42
- package/dist/web-chat/node_modules/.bin/uuid +0 -2
- package/dist/web-chat/node_modules/.bin/uvu +0 -35
- package/dist/web-chat/node_modules/.bin/vite +0 -61
- package/dist/web-chat/node_modules/.package-lock.json +0 -15371
- package/dist/web-chat/node_modules/.vite/deps/_metadata.json +0 -67
- package/dist/web-chat/node_modules/.vite/deps/chunk-DC5AMYBS.js +0 -39
- package/dist/web-chat/node_modules/.vite/deps/chunk-DC5AMYBS.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/chunk-NUMECXU6.js +0 -21628
- package/dist/web-chat/node_modules/.vite/deps/chunk-NUMECXU6.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/chunk-RLJ2RCJQ.js +0 -1906
- package/dist/web-chat/node_modules/.vite/deps/chunk-RLJ2RCJQ.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/chunk-S725DACQ.js +0 -928
- package/dist/web-chat/node_modules/.vite/deps/chunk-S725DACQ.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/chunk-XJVUMEYI.js +0 -8578
- package/dist/web-chat/node_modules/.vite/deps/chunk-XJVUMEYI.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/package.json +0 -3
- package/dist/web-chat/node_modules/.vite/deps/react-dom.js +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react-dom.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react-dom_client.js +0 -39
- package/dist/web-chat/node_modules/.vite/deps/react-dom_client.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react-markdown.js +0 -8931
- package/dist/web-chat/node_modules/.vite/deps/react-markdown.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react.js +0 -6
- package/dist/web-chat/node_modules/.vite/deps/react.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -913
- package/dist/web-chat/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react_jsx-runtime.js +0 -7
- package/dist/web-chat/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
- package/dist/web-chat/node_modules/.vite/deps/remark-gfm.js +0 -7403
- package/dist/web-chat/node_modules/.vite/deps/remark-gfm.js.map +0 -7
- package/dist/web-chat/node_modules/@codemirror/autocomplete/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/commands/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-cpp/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-css/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-go/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-java/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-javascript/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-json/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-less/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-markdown/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-python/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-rust/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-sass/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-sql/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-wast/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-xml/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lang-yaml/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/language/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/language-data/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/legacy-modes/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/lint/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/search/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/state/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/theme-one-dark/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@codemirror/view/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/@lezer/html/src/.tern-port +0 -1
- package/dist/web-chat/node_modules/@lezer/php/.tern-port +0 -1
- package/dist/web-chat/node_modules/@lezer/php/test/.tern-port +0 -1
- package/dist/web-chat/node_modules/@lezer/sass/src/.tern-port +0 -1
- package/dist/web-chat/node_modules/@lezer/yaml/.tern-port +0 -1
- package/dist/web-chat/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml +0 -31
- package/dist/web-chat/node_modules/bl/.travis.yml +0 -17
- package/dist/web-chat/node_modules/clean-set/.prettierrc +0 -4
- package/dist/web-chat/node_modules/clean-set/.travis.yml +0 -7
- package/dist/web-chat/node_modules/codemirror/.github/workflows/dispatch.yml +0 -16
- package/dist/web-chat/node_modules/entities/src/generated/.eslintrc.json +0 -10
- package/dist/web-chat/node_modules/es5-ext/promise/.eslintrc.json +0 -1
- package/dist/web-chat/node_modules/es6-iterator/.editorconfig +0 -14
- package/dist/web-chat/node_modules/es6-iterator/test/.eslintrc.json +0 -5
- package/dist/web-chat/node_modules/es6-symbol/.testignore +0 -1
- package/dist/web-chat/node_modules/escape-carriage/.github/workflows/node.js.yml +0 -19
- package/dist/web-chat/node_modules/esniff/.prettierignore +0 -2
- package/dist/web-chat/node_modules/esniff/.testignore +0 -3
- package/dist/web-chat/node_modules/event-emitter/.lint +0 -15
- package/dist/web-chat/node_modules/event-emitter/.testignore +0 -1
- package/dist/web-chat/node_modules/event-emitter/.travis.yml +0 -16
- package/dist/web-chat/node_modules/expand-template/.travis.yml +0 -6
- package/dist/web-chat/node_modules/extend/.editorconfig +0 -20
- package/dist/web-chat/node_modules/extend/.eslintrc +0 -17
- package/dist/web-chat/node_modules/extend/.jscs.json +0 -175
- package/dist/web-chat/node_modules/extend/.travis.yml +0 -230
- package/dist/web-chat/node_modules/gensync/test/.babelrc +0 -5
- package/dist/web-chat/node_modules/github-from-package/.travis.yml +0 -4
- package/dist/web-chat/node_modules/intersection-observer/.eslintrc +0 -45
- package/dist/web-chat/node_modules/lib0/.github/workflows/node.js.yml +0 -24
- package/dist/web-chat/node_modules/lib0/.jsdoc.json +0 -18
- package/dist/web-chat/node_modules/lib0/.vscode/launch.json +0 -17
- package/dist/web-chat/node_modules/minimist/.eslintrc +0 -29
- package/dist/web-chat/node_modules/minimist/.github/FUNDING.yml +0 -12
- package/dist/web-chat/node_modules/minimist/.nycrc +0 -14
- package/dist/web-chat/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +0 -31
- package/dist/web-chat/node_modules/next-tick/.editorconfig +0 -16
- package/dist/web-chat/node_modules/next-tick/.github/FUNDING.yml +0 -1
- package/dist/web-chat/node_modules/next-tick/.lint +0 -16
- package/dist/web-chat/node_modules/node-abi/node_modules/.bin/semver +0 -191
- package/dist/web-chat/node_modules/pump/.github/FUNDING.yml +0 -2
- package/dist/web-chat/node_modules/pump/.travis.yml +0 -5
- package/dist/web-chat/node_modules/simple-concat/.travis.yml +0 -3
- package/dist/web-chat/node_modules/simple-get/.github/dependabot.yml +0 -15
- package/dist/web-chat/node_modules/simple-get/.github/workflows/ci.yml +0 -23
- package/dist/web-chat/node_modules/tar-fs/.travis.yml +0 -6
- package/dist/web-chat/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/dist/web-chat/node_modules/w3c-keyname/.tern-port +0 -1
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
(function() {
|
|
3
|
-
|
|
4
|
-
var fs = require('fs');
|
|
5
|
-
var stringEscape = require('../jsesc.js');
|
|
6
|
-
var strings = process.argv.splice(2);
|
|
7
|
-
var stdin = process.stdin;
|
|
8
|
-
var data;
|
|
9
|
-
var timeout;
|
|
10
|
-
var isObject = false;
|
|
11
|
-
var options = {};
|
|
12
|
-
var log = console.log;
|
|
13
|
-
|
|
14
|
-
var main = function() {
|
|
15
|
-
var option = strings[0];
|
|
16
|
-
|
|
17
|
-
if (/^(?:-h|--help|undefined)$/.test(option)) {
|
|
18
|
-
log(
|
|
19
|
-
'jsesc v%s - https://mths.be/jsesc',
|
|
20
|
-
stringEscape.version
|
|
21
|
-
);
|
|
22
|
-
log([
|
|
23
|
-
'\nUsage:\n',
|
|
24
|
-
'\tjsesc [string]',
|
|
25
|
-
'\tjsesc [-s | --single-quotes] [string]',
|
|
26
|
-
'\tjsesc [-d | --double-quotes] [string]',
|
|
27
|
-
'\tjsesc [-w | --wrap] [string]',
|
|
28
|
-
'\tjsesc [-e | --escape-everything] [string]',
|
|
29
|
-
'\tjsesc [-t | --escape-etago] [string]',
|
|
30
|
-
'\tjsesc [-6 | --es6] [string]',
|
|
31
|
-
'\tjsesc [-l | --lowercase-hex] [string]',
|
|
32
|
-
'\tjsesc [-j | --json] [string]',
|
|
33
|
-
'\tjsesc [-o | --object] [stringified_object]', // `JSON.parse()` the argument
|
|
34
|
-
'\tjsesc [-p | --pretty] [string]', // `compact: false`
|
|
35
|
-
'\tjsesc [-v | --version]',
|
|
36
|
-
'\tjsesc [-h | --help]',
|
|
37
|
-
'\nExamples:\n',
|
|
38
|
-
'\tjsesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
|
|
39
|
-
'\tjsesc --json \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
|
|
40
|
-
'\tjsesc --json --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
|
|
41
|
-
'\tjsesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
|
|
42
|
-
'\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | jsesc'
|
|
43
|
-
].join('\n'));
|
|
44
|
-
return process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (/^(?:-v|--version)$/.test(option)) {
|
|
48
|
-
log('v%s', stringEscape.version);
|
|
49
|
-
return process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
strings.forEach(function(string) {
|
|
53
|
-
// Process options
|
|
54
|
-
if (/^(?:-s|--single-quotes)$/.test(string)) {
|
|
55
|
-
options.quotes = 'single';
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (/^(?:-d|--double-quotes)$/.test(string)) {
|
|
59
|
-
options.quotes = 'double';
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (/^(?:-w|--wrap)$/.test(string)) {
|
|
63
|
-
options.wrap = true;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (/^(?:-e|--escape-everything)$/.test(string)) {
|
|
67
|
-
options.escapeEverything = true;
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (/^(?:-t|--escape-etago)$/.test(string)) {
|
|
71
|
-
options.escapeEtago = true;
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (/^(?:-6|--es6)$/.test(string)) {
|
|
75
|
-
options.es6 = true;
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (/^(?:-l|--lowercase-hex)$/.test(string)) {
|
|
79
|
-
options.lowercaseHex = true;
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (/^(?:-j|--json)$/.test(string)) {
|
|
83
|
-
options.json = true;
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (/^(?:-o|--object)$/.test(string)) {
|
|
87
|
-
isObject = true;
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (/^(?:-p|--pretty)$/.test(string)) {
|
|
91
|
-
isObject = true;
|
|
92
|
-
options.compact = false;
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Process string(s)
|
|
97
|
-
var result;
|
|
98
|
-
try {
|
|
99
|
-
if (isObject) {
|
|
100
|
-
string = JSON.parse(string);
|
|
101
|
-
}
|
|
102
|
-
result = stringEscape(string, options);
|
|
103
|
-
log(result);
|
|
104
|
-
} catch(error) {
|
|
105
|
-
log(error.message + '\n');
|
|
106
|
-
log('Error: failed to escape.');
|
|
107
|
-
log('If you think this is a bug in jsesc, please report it:');
|
|
108
|
-
log('https://github.com/mathiasbynens/jsesc/issues/new');
|
|
109
|
-
log(
|
|
110
|
-
'\nStack trace using jsesc@%s:\n',
|
|
111
|
-
stringEscape.version
|
|
112
|
-
);
|
|
113
|
-
log(error.stack);
|
|
114
|
-
return process.exit(1);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
// Return with exit status 0 outside of the `forEach` loop, in case
|
|
118
|
-
// multiple strings were passed in.
|
|
119
|
-
return process.exit(0);
|
|
120
|
-
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
if (stdin.isTTY) {
|
|
124
|
-
// handle shell arguments
|
|
125
|
-
main();
|
|
126
|
-
} else {
|
|
127
|
-
// Either the script is called from within a non-TTY context,
|
|
128
|
-
// or `stdin` content is being piped in.
|
|
129
|
-
if (!process.stdout.isTTY) { // called from a non-TTY context
|
|
130
|
-
timeout = setTimeout(function() {
|
|
131
|
-
// if no piped data arrived after a while, handle shell arguments
|
|
132
|
-
main();
|
|
133
|
-
}, 250);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
data = '';
|
|
137
|
-
stdin.on('data', function(chunk) {
|
|
138
|
-
clearTimeout(timeout);
|
|
139
|
-
data += chunk;
|
|
140
|
-
});
|
|
141
|
-
stdin.on('end', function() {
|
|
142
|
-
strings.push(data.trim());
|
|
143
|
-
main();
|
|
144
|
-
});
|
|
145
|
-
stdin.resume();
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
}());
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs')
|
|
4
|
-
const path = require('path')
|
|
5
|
-
const pkg = require('../package.json')
|
|
6
|
-
const JSON5 = require('./')
|
|
7
|
-
|
|
8
|
-
const argv = parseArgs()
|
|
9
|
-
|
|
10
|
-
if (argv.version) {
|
|
11
|
-
version()
|
|
12
|
-
} else if (argv.help) {
|
|
13
|
-
usage()
|
|
14
|
-
} else {
|
|
15
|
-
const inFilename = argv.defaults[0]
|
|
16
|
-
|
|
17
|
-
let readStream
|
|
18
|
-
if (inFilename) {
|
|
19
|
-
readStream = fs.createReadStream(inFilename)
|
|
20
|
-
} else {
|
|
21
|
-
readStream = process.stdin
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
let json5 = ''
|
|
25
|
-
readStream.on('data', data => {
|
|
26
|
-
json5 += data
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
readStream.on('end', () => {
|
|
30
|
-
let space
|
|
31
|
-
if (argv.space === 't' || argv.space === 'tab') {
|
|
32
|
-
space = '\t'
|
|
33
|
-
} else {
|
|
34
|
-
space = Number(argv.space)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let value
|
|
38
|
-
try {
|
|
39
|
-
value = JSON5.parse(json5)
|
|
40
|
-
if (!argv.validate) {
|
|
41
|
-
const json = JSON.stringify(value, null, space)
|
|
42
|
-
|
|
43
|
-
let writeStream
|
|
44
|
-
|
|
45
|
-
// --convert is for backward compatibility with v0.5.1. If
|
|
46
|
-
// specified with <file> and not --out-file, then a file with
|
|
47
|
-
// the same name but with a .json extension will be written.
|
|
48
|
-
if (argv.convert && inFilename && !argv.outFile) {
|
|
49
|
-
const parsedFilename = path.parse(inFilename)
|
|
50
|
-
const outFilename = path.format(
|
|
51
|
-
Object.assign(
|
|
52
|
-
parsedFilename,
|
|
53
|
-
{base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'}
|
|
54
|
-
)
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
writeStream = fs.createWriteStream(outFilename)
|
|
58
|
-
} else if (argv.outFile) {
|
|
59
|
-
writeStream = fs.createWriteStream(argv.outFile)
|
|
60
|
-
} else {
|
|
61
|
-
writeStream = process.stdout
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
writeStream.write(json)
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
console.error(err.message)
|
|
68
|
-
process.exit(1)
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function parseArgs () {
|
|
74
|
-
let convert
|
|
75
|
-
let space
|
|
76
|
-
let validate
|
|
77
|
-
let outFile
|
|
78
|
-
let version
|
|
79
|
-
let help
|
|
80
|
-
const defaults = []
|
|
81
|
-
|
|
82
|
-
const args = process.argv.slice(2)
|
|
83
|
-
for (let i = 0; i < args.length; i++) {
|
|
84
|
-
const arg = args[i]
|
|
85
|
-
switch (arg) {
|
|
86
|
-
case '--convert':
|
|
87
|
-
case '-c':
|
|
88
|
-
convert = true
|
|
89
|
-
break
|
|
90
|
-
|
|
91
|
-
case '--space':
|
|
92
|
-
case '-s':
|
|
93
|
-
space = args[++i]
|
|
94
|
-
break
|
|
95
|
-
|
|
96
|
-
case '--validate':
|
|
97
|
-
case '-v':
|
|
98
|
-
validate = true
|
|
99
|
-
break
|
|
100
|
-
|
|
101
|
-
case '--out-file':
|
|
102
|
-
case '-o':
|
|
103
|
-
outFile = args[++i]
|
|
104
|
-
break
|
|
105
|
-
|
|
106
|
-
case '--version':
|
|
107
|
-
case '-V':
|
|
108
|
-
version = true
|
|
109
|
-
break
|
|
110
|
-
|
|
111
|
-
case '--help':
|
|
112
|
-
case '-h':
|
|
113
|
-
help = true
|
|
114
|
-
break
|
|
115
|
-
|
|
116
|
-
default:
|
|
117
|
-
defaults.push(arg)
|
|
118
|
-
break
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
convert,
|
|
124
|
-
space,
|
|
125
|
-
validate,
|
|
126
|
-
outFile,
|
|
127
|
-
version,
|
|
128
|
-
help,
|
|
129
|
-
defaults,
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function version () {
|
|
134
|
-
console.log(pkg.version)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function usage () {
|
|
138
|
-
console.log(
|
|
139
|
-
`
|
|
140
|
-
Usage: json5 [options] <file>
|
|
141
|
-
|
|
142
|
-
If <file> is not provided, then STDIN is used.
|
|
143
|
-
|
|
144
|
-
Options:
|
|
145
|
-
|
|
146
|
-
-s, --space The number of spaces to indent or 't' for tabs
|
|
147
|
-
-o, --out-file [file] Output to the specified file, otherwise STDOUT
|
|
148
|
-
-v, --validate Validate JSON5 but do not output JSON
|
|
149
|
-
-V, --version Output the version number
|
|
150
|
-
-h, --help Output usage information`
|
|
151
|
-
)
|
|
152
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Simple CLI for KaTeX.
|
|
3
|
-
// Reads TeX from stdin, outputs HTML to stdout.
|
|
4
|
-
// To run this from the repository, you must first build KaTeX by running
|
|
5
|
-
// `yarn` and `yarn build`.
|
|
6
|
-
|
|
7
|
-
/* eslint no-console:0 */
|
|
8
|
-
|
|
9
|
-
let katex;
|
|
10
|
-
try {
|
|
11
|
-
katex = require("./");
|
|
12
|
-
} catch (e) {
|
|
13
|
-
console.error(
|
|
14
|
-
"KaTeX could not import, likely because dist/katex.js is missing.");
|
|
15
|
-
console.error("Please run 'yarn' and 'yarn build' before running");
|
|
16
|
-
console.error("cli.js from the KaTeX repository.");
|
|
17
|
-
console.error();
|
|
18
|
-
throw e;
|
|
19
|
-
}
|
|
20
|
-
const {version} = require("./package.json");
|
|
21
|
-
const fs = require("fs");
|
|
22
|
-
|
|
23
|
-
const program = require("commander").version(version);
|
|
24
|
-
for (const prop in katex.SETTINGS_SCHEMA) {
|
|
25
|
-
if (katex.SETTINGS_SCHEMA.hasOwnProperty(prop)) {
|
|
26
|
-
const opt = katex.SETTINGS_SCHEMA[prop];
|
|
27
|
-
if (opt.cli !== false) {
|
|
28
|
-
program.option(opt.cli || "--" + prop, opt.cliDescription ||
|
|
29
|
-
opt.description, opt.cliProcessor, opt.cliDefault);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
program.option("-f, --macro-file <path>",
|
|
34
|
-
"Read macro definitions, one per line, from the given file.")
|
|
35
|
-
.option("-i, --input <path>", "Read LaTeX input from the given file.")
|
|
36
|
-
.option("-o, --output <path>", "Write html output to the given file.");
|
|
37
|
-
|
|
38
|
-
let options;
|
|
39
|
-
|
|
40
|
-
function readMacros() {
|
|
41
|
-
if (options.macroFile) {
|
|
42
|
-
fs.readFile(options.macroFile, "utf-8", function(err, data) {
|
|
43
|
-
if (err) {throw err;}
|
|
44
|
-
splitMacros(data.toString().split('\n'));
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
splitMacros([]);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function splitMacros(macroStrings) {
|
|
52
|
-
// Override macros from macro file (if any)
|
|
53
|
-
// with macros from command line (if any)
|
|
54
|
-
macroStrings = macroStrings.concat(options.macro);
|
|
55
|
-
|
|
56
|
-
const macros = {};
|
|
57
|
-
|
|
58
|
-
for (const m of macroStrings) {
|
|
59
|
-
const i = m.search(":");
|
|
60
|
-
if (i !== -1) {
|
|
61
|
-
macros[m.substring(0, i).trim()] = m.substring(i + 1).trim();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
options.macros = macros;
|
|
66
|
-
readInput();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function readInput() {
|
|
70
|
-
let input = "";
|
|
71
|
-
|
|
72
|
-
if (options.input) {
|
|
73
|
-
fs.readFile(options.input, "utf-8", function(err, data) {
|
|
74
|
-
if (err) {throw err;}
|
|
75
|
-
input = data.toString();
|
|
76
|
-
writeOutput(input);
|
|
77
|
-
});
|
|
78
|
-
} else {
|
|
79
|
-
process.stdin.on("data", function(chunk) {
|
|
80
|
-
input += chunk.toString();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
process.stdin.on("end", function() {
|
|
84
|
-
writeOutput(input);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function writeOutput(input) {
|
|
90
|
-
// --format specifies the KaTeX output
|
|
91
|
-
const outputFile = options.output;
|
|
92
|
-
options.output = options.format;
|
|
93
|
-
|
|
94
|
-
const output = katex.renderToString(input, options) + "\n";
|
|
95
|
-
|
|
96
|
-
if (outputFile) {
|
|
97
|
-
fs.writeFile(outputFile, output, function(err) {
|
|
98
|
-
if (err) {
|
|
99
|
-
return console.log(err);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
} else {
|
|
103
|
-
console.log(output);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (require.main !== module) {
|
|
108
|
-
module.exports = program;
|
|
109
|
-
} else {
|
|
110
|
-
options = program.parse(process.argv).opts();
|
|
111
|
-
readMacros();
|
|
112
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var looseEnvify = require('./');
|
|
5
|
-
var fs = require('fs');
|
|
6
|
-
|
|
7
|
-
if (process.argv[2]) {
|
|
8
|
-
fs.createReadStream(process.argv[2], {encoding: 'utf8'})
|
|
9
|
-
.pipe(looseEnvify(process.argv[2]))
|
|
10
|
-
.pipe(process.stdout);
|
|
11
|
-
} else {
|
|
12
|
-
process.stdin.resume()
|
|
13
|
-
process.stdin
|
|
14
|
-
.pipe(looseEnvify(__filename))
|
|
15
|
-
.pipe(process.stdout);
|
|
16
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#! /usr/bin/env node
|
|
2
|
-
var lzString = require('../libs/lz-string.js');
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
|
|
5
|
-
if (process.argv.length < 3) {
|
|
6
|
-
console.error('Usage: lz-string <input_file>');
|
|
7
|
-
process.exit(1);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
console.log(lzString.compress(fs.readFileSync(process.argv[2], {
|
|
11
|
-
encoding: 'utf8',
|
|
12
|
-
})));
|
|
13
|
-
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
let { nanoid, customAlphabet } = require('..')
|
|
4
|
-
|
|
5
|
-
function print(msg) {
|
|
6
|
-
process.stdout.write(msg + '\n')
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function error(msg) {
|
|
10
|
-
process.stderr.write(msg + '\n')
|
|
11
|
-
process.exit(1)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
15
|
-
print(`
|
|
16
|
-
Usage
|
|
17
|
-
$ nanoid [options]
|
|
18
|
-
|
|
19
|
-
Options
|
|
20
|
-
-s, --size Generated ID size
|
|
21
|
-
-a, --alphabet Alphabet to use
|
|
22
|
-
-h, --help Show this help
|
|
23
|
-
|
|
24
|
-
Examples
|
|
25
|
-
$ nanoid --s 15
|
|
26
|
-
S9sBF77U6sDB8Yg
|
|
27
|
-
|
|
28
|
-
$ nanoid --size 10 --alphabet abc
|
|
29
|
-
bcabababca`)
|
|
30
|
-
process.exit()
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let alphabet, size
|
|
34
|
-
for (let i = 2; i < process.argv.length; i++) {
|
|
35
|
-
let arg = process.argv[i]
|
|
36
|
-
if (arg === '--size' || arg === '-s') {
|
|
37
|
-
size = Number(process.argv[i + 1])
|
|
38
|
-
i += 1
|
|
39
|
-
if (Number.isNaN(size) || size <= 0) {
|
|
40
|
-
error('Size must be positive integer')
|
|
41
|
-
}
|
|
42
|
-
} else if (arg === '--alphabet' || arg === '-a') {
|
|
43
|
-
alphabet = process.argv[i + 1]
|
|
44
|
-
i += 1
|
|
45
|
-
} else {
|
|
46
|
-
error('Unknown argument ' + arg)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (alphabet) {
|
|
51
|
-
let customNanoid = customAlphabet(alphabet, size)
|
|
52
|
-
print(customNanoid())
|
|
53
|
-
} else {
|
|
54
|
-
print(nanoid(size))
|
|
55
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/* eslint-disable no-var, unicorn/prefer-node-protocol */
|
|
3
|
-
|
|
4
|
-
var parser = require("..");
|
|
5
|
-
var fs = require("fs");
|
|
6
|
-
|
|
7
|
-
var filename = process.argv[2];
|
|
8
|
-
if (!filename) {
|
|
9
|
-
console.error("no filename specified");
|
|
10
|
-
} else {
|
|
11
|
-
var file = fs.readFileSync(filename, "utf8");
|
|
12
|
-
var ast = parser.parse(file);
|
|
13
|
-
|
|
14
|
-
console.log(JSON.stringify(ast, null, " "));
|
|
15
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const path = require('path')
|
|
4
|
-
const fs = require('fs')
|
|
5
|
-
const napi = require('napi-build-utils')
|
|
6
|
-
|
|
7
|
-
const pkg = require(path.resolve('package.json'))
|
|
8
|
-
const rc = require('./rc')(pkg)
|
|
9
|
-
const log = require('./log')(rc, process.env)
|
|
10
|
-
const download = require('./download')
|
|
11
|
-
const asset = require('./asset')
|
|
12
|
-
const util = require('./util')
|
|
13
|
-
|
|
14
|
-
const prebuildClientVersion = require('./package.json').version
|
|
15
|
-
if (rc.version) {
|
|
16
|
-
console.log(prebuildClientVersion)
|
|
17
|
-
process.exit(0)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (rc.path) process.chdir(rc.path)
|
|
21
|
-
|
|
22
|
-
if (rc.runtime === 'electron' && rc.target[0] === '4' && rc.abi === '64') {
|
|
23
|
-
log.error(`Electron version ${rc.target} found - skipping prebuild-install work due to known ABI issue`)
|
|
24
|
-
log.error('More information about this issue can be found at https://github.com/lgeiger/node-abi/issues/54')
|
|
25
|
-
process.exit(1)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (!fs.existsSync('package.json')) {
|
|
29
|
-
log.error('setup', 'No package.json found. Aborting...')
|
|
30
|
-
process.exit(1)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (rc.help) {
|
|
34
|
-
console.error(fs.readFileSync(path.join(__dirname, 'help.txt'), 'utf-8'))
|
|
35
|
-
process.exit(0)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
log.info('begin', 'Prebuild-install version', prebuildClientVersion)
|
|
39
|
-
|
|
40
|
-
const opts = Object.assign({}, rc, { pkg: pkg, log: log })
|
|
41
|
-
|
|
42
|
-
if (napi.isNapiRuntime(rc.runtime)) napi.logUnsupportedVersion(rc.target, log)
|
|
43
|
-
|
|
44
|
-
const origin = util.packageOrigin(process.env, pkg)
|
|
45
|
-
|
|
46
|
-
if (opts.force) {
|
|
47
|
-
log.warn('install', 'prebuilt binaries enforced with --force!')
|
|
48
|
-
log.warn('install', 'prebuilt binaries may be out of date!')
|
|
49
|
-
} else if (origin && origin.length > 4 && origin.substr(0, 4) === 'git+') {
|
|
50
|
-
log.info('install', 'installing from git repository, skipping download.')
|
|
51
|
-
process.exit(1)
|
|
52
|
-
} else if (opts.buildFromSource) {
|
|
53
|
-
log.info('install', '--build-from-source specified, not attempting download.')
|
|
54
|
-
process.exit(1)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const startDownload = function (downloadUrl) {
|
|
58
|
-
download(downloadUrl, opts, function (err) {
|
|
59
|
-
if (err) {
|
|
60
|
-
log.warn('install', err.message)
|
|
61
|
-
return process.exit(1)
|
|
62
|
-
}
|
|
63
|
-
log.info('install', 'Successfully installed prebuilt binary!')
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (opts.token) {
|
|
68
|
-
asset(opts, function (err, assetId) {
|
|
69
|
-
if (err) {
|
|
70
|
-
log.warn('install', err.message)
|
|
71
|
-
return process.exit(1)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
startDownload(util.getAssetUrl(opts, assetId))
|
|
75
|
-
})
|
|
76
|
-
} else {
|
|
77
|
-
startDownload(util.getDownloadUrl(opts))
|
|
78
|
-
}
|