New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jsafe

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsafe

very fast queue for JSON write queries

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

JSafe

Very fast queue for JSON write queries.

Install

npm install jsafe

Import

const { write, read } = require("jsafe")

Functions

write(jsonPath, jsonData)promise

Add JSON object to write or to stack.

read(jsonPath, defaultJsonData)object

Read the JSON file if it exists.

write(jsonPath, jsonData) ⇒ promise

Add JSON object to write or to stack.

Kind: global function Returns: promise - - But catch error is optional.

ParamTypeDescription
jsonPathstringThe path of json file.
jsonDataobjectJSON stringable data.
write("./file.json", json)
// Check if a writing is in progress.
// If so, overwrites the waiting stack
// with the new version of the file.

read(jsonPath, defaultJsonData) ⇒ object

Read the JSON file if it exists.

Kind: global function Returns: object - - JSON exploitable data.

ParamTypeDescription
jsonPathstringThe path of json file.
defaultJsonDataobjectJSON stringable data.
const json = read("./file.json", "Hello World")
// Require json and delete require.cache.
// To do only once in the same script.
// Returns defaultJsonData if the file is non-existent.

Keywords

json

FAQs

Package last updated on 05 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts