Source transform static js-yaml expressions to remove yaml
npm install static-js-yamlSource transform static [js-yaml][js-yaml] expressions to remove yaml.
[js-yaml]: https://www.npmjs.com/package/js-yaml
Source:
``js`
var yaml = require("static-js-yaml");
console.log(yaml.safeLoad("foo: 1"));
console.log(yaml.dump({foo: 1}));
Becomes:
`js`
console.log({ foo: 1 });
1. Use the static-js-yaml module with *[statically-analyzablejs-yaml
expressions][static-eval]* in place of the module.js-yaml/transform
1. Use the module as a [browserify transform][] to
transform your source.
js-yaml/transform
[static-eval]: https://www.npmjs.com/package/static-eval
[browserify transform]: https://github.com/substack/browserify-handbook#transforms
A subset of the js-yaml API is exported: safeLoad, load,safeDump, dump` (everything but multi-document loaders).
The transform module is implemented as a browserify transform function
but can be used directly without browserify.