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.2 to 0.0.3

2

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

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

# Async JSON parser
## parse
## parse, stringify
```js
import fs from 'fs';
import {parse} from 'async-json-parser';
import { parse, stringify } from 'async-json-parser';
import request from 'request';
const URL = 'http://auction-api-eu.worldofwarcraft.com/auction-data/258993a3c6b974ef3e6f22ea6f822720/auctions.json';
const get = (url) => {
return new Promise(resolve => {
request(url, (res, err, body) => {
resolve(body)
})
})
};
(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');
const data = await get(URL);
const res = await parse(data);
const str = await stringify(json);
fs.writeFileSync('data.json', str);
})();
```
## Parser
```js

@@ -28,14 +41,1 @@ import Parser from 'async-json-parser/parser'

## 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