unified

Project: syntax-tree/unist-builder-blueprint-cli

Package: unist-builder-blueprint-cli@1.1.1

  1. Dependencies: 0·Dependents: 0
  2. CLI to convert unist trees to unist-builder notation
  1. util 107
  2. utility 105
  3. unist 97
  4. tree 40
  5. syntax 30
  6. ast 27
  7. unist-util 24
  8. cst 8
  9. cli 5
  10. unist-builder 2
  11. blueprint 2

unist-builder-blueprint-cli

Build Coverage Downloads Sponsors Backers Chat

CLI to transform unist trees to unist-builder notation.

Install

npm:

npm install -g unist-builder-blueprint-cli

Use

Stdin:

$ unist-builder-blueprint  <<< '{"type":"text","value":"alpha"}'
u('text', 'alpha')

File:

$ cat input.json
{
  "type": "node",
  "root": true,
  "children": [
    {"type": "literal", "value": 1},
    {"type": "literal", "value": "bravo"}
  ]
}
$ unist-builder-blueprint input.json
u('node', { root: true }, [
    u('literal', 1),
    u('literal', 'bravo')
])

Formatting options for escodegen:

$ unist-builder-blueprint --format.indent.style="  " --format.quotes=double input.json
u("node", { root: true }, [
  u("literal", 1),
  u("literal", "bravo")
])

CLI

Usage: unist-builder-blueprint [--builder <u>] [escodegen_opts]... [<file>]

  Convert <file> (stdin by default) to unist-builder notation.

  Accepts options for escodegen. See escodegen wiki for details.

Options:
  --builder <u>  Builder function to use (default: "u")

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Eugene Sharygin