New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

async-json-parser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-json-parser - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

data.json

2

package.json
{
"name": "async-json-parser",
"version": "0.0.3",
"version": "0.0.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.mjs",

# Async JSON parser
## parse, stringify
## parse
```js
import fs from 'fs';
import { parse, stringify } from 'async-json-parser';
import { parse } from 'async-json-parser';
import request from 'request';

@@ -22,5 +21,3 @@

const data = await get(URL);
const res = await parse(data);
const str = await stringify(json);
fs.writeFileSync('data.json', str);
const result = await parse(data);
})();

@@ -42,1 +39,29 @@ ```

## parse stream
```js
import fs from 'fs';
import {parse} from 'async-json-parser';
import json from './test.json';
(async () => {
const stream = fs.createReadStream('test.json');
const res = await parse(stream);
console.log(+res['a1'][0].address.geo.lat === -37.3159);
console.log(res['a457'][2].address.suite === 'Suite 847');
})();
```
## stringify
```js
import fs from 'fs';
import {stringify} from 'async-json-parser';
import json from './test.json';
(async () => {
const data = await stringify(json);
fs.writeFileSync('data.json', data);
})();
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc