-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip CI tests for Node.js < 20
- Loading branch information
Showing
17 changed files
with
503 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env node | ||
|
||
import { UserError, cli, help } from './dist/cli.mjs' | ||
|
||
cli(process.stdin, error => { | ||
if (error instanceof UserError) { | ||
if (error.code === UserError.ARGS) console.error(`${help}\n`) | ||
console.error(error.message) | ||
process.exitCode = error.code | ||
} else if (error) throw error | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { chmod, stat } from 'node:fs/promises' | ||
import typescript from '@rollup/plugin-typescript' | ||
|
||
export default { | ||
input: { | ||
index: 'src/index.ts', | ||
'test-events': 'src/test-events.ts', | ||
util: 'src/util.ts' | ||
export default [ | ||
{ | ||
input: { | ||
index: 'src/index.ts', | ||
'test-events': 'src/test-events.ts', | ||
util: 'src/util.ts' | ||
}, | ||
output: { | ||
dir: 'dist', | ||
format: 'cjs', | ||
esModule: false, | ||
preserveModules: true | ||
}, | ||
plugins: [typescript()], | ||
treeshake: { moduleSideEffects: false, propertyReadSideEffects: false } | ||
}, | ||
output: { | ||
dir: 'dist', | ||
format: 'cjs', | ||
esModule: false, | ||
preserveModules: true | ||
}, | ||
plugins: [typescript()], | ||
treeshake: { moduleSideEffects: false, propertyReadSideEffects: false } | ||
} | ||
{ | ||
input: 'src/cli.ts', | ||
output: { file: 'dist/cli.mjs' }, | ||
external: () => true, | ||
plugins: [typescript()] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Command-line Tool | ||
|
||
Available as `npx yaml` or `npm exec yaml`: | ||
|
||
<pre id="cli-help" style="float: none"> | ||
yaml: A command-line YAML processor and inspector | ||
|
||
Reads stdin and writes output to stdout and errors & warnings to stderr. | ||
|
||
Usage: | ||
yaml Process a YAML stream, outputting it as YAML | ||
yaml cst Parse the CST of a YAML stream | ||
yaml lex Parse the lexical tokens of a YAML stream | ||
yaml valid Validate a YAML stream, returning 0 on success | ||
|
||
Options: | ||
--help, -h Show this message. | ||
--json, -j Output JSON. | ||
|
||
Additional options for bare "yaml" command: | ||
--doc, -d Output pretty-printed JS Document objects. | ||
--single, -1 Require the input to consist of a single YAML document. | ||
--strict, -s Stop on errors. | ||
--visit, -v Apply a visitor to each document (requires a path to import) | ||
--yaml 1.1 Set the YAML version. (default: 1.2) | ||
</pre> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.