ndjson-to-json-text
Convert ndjson text to JSON text without JSON parsing.
This library convert ndjson text to json text.
{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}
{"id":3,"name":"Carol"}
to
Purpose
- Just convert ndjson(text file) to json(text file)
- You should
JSON.parse
the result json text outside of this library
- You should
- No use
JSON.parse
in this library- It is a cost
Install
Install with npm:
npm install ndjson-to-json-text
Usage
/** * Convert ndjson text to JSON text * The return value is a string of JSON array text * @param ndjsonText */declare ;
Example
const jsonText = console;// [{"id":1,"name":"Alice"},{"id":2,"name":"Bob"},{"id":3,"name":"Carol"}]const json = JSON;// actual json object!!
Related
- madnight/ndjson-to-json: Converts NDJSON to JSON
- It only work on Node.js
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm test
# Update snapshot
npm run updateSnapshot
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu