https://github.com/jstransformers/jstransformer-toml
TOML support for JSTransformers
https://github.com/jstransformers/jstransformer-toml
Last synced: 12 months ago
JSON representation
TOML support for JSTransformers
- Host: GitHub
- URL: https://github.com/jstransformers/jstransformer-toml
- Owner: jstransformers
- License: mit
- Created: 2015-04-03T13:45:18.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T03:36:11.000Z (about 6 years ago)
- Last Synced: 2025-05-25T21:06:27.385Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://npm.im/jstransformer-toml
- Size: 59.6 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# jstransforer-toml
[TOML](https://github.com/BinaryMuse/toml-node) support for JSTransformers.
[](https://travis-ci.org/jstransformers/jstransformer-toml)
[](https://codecov.io/gh/jstransformers/jstransformer-toml)
[](http://david-dm.org/jstransformers/jstransformer-toml)
[](https://www.npmjs.org/package/jstransformer-toml)
## Installation
npm install jstransformer-toml
## API
```js
var toml = require('jstransformer')(require('jstransformer-toml'));
var opts = {};
var result = toml.render('[toml]\nbar = "baz"\nqux = true', opts);
console.log(JSON.parse(result).body)
//=> '{"toml": {"bar": "baz", "qux": true}}'
var promise = toml.renderFileAsync('./path/to/config.toml', opts);
promise.then(function(data) {
console.log(JSON.parse(result).body);
//=> '{"toml": {"bar": "baz", "qux": true}}'
});
```
## License
MIT