
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
json-data-services
Advanced tools
Combines multiple services to help working with json-data manipulation, synchronisation and validation.
DataService
manages application state and retrieval. Additional supports undo.ValidationService
validates any data by a given JSON-schema.SchemaService
returns the JSON-schema at the given JSON-pointer locationAll services offer an interface based on JSON-pointer.
Data can only be changed via the data-service methods. Each state is tracked within the services, enabling und/redo functionality.
// get data at json-pointer
const dataService = new DataService(new State(), jsonData);
dataService.get("#/content/header/title");
// Set data at given path
dataService.set(pointer, data);
// Set data at given path
dataService.delete(pointer, data);
// Set last set/delete action
dataService.undo();
// redo last undo action
dataService.redo();
// called before any data changes of the action
dataService.on("beforeUpdate", callback)
// called after data changes, before observe events
dataService.on("afterUpdate", callback)
// Events bubble up to root pointer (#), # is last event
dataService.observe(pointer, callback, true)
// callbacks
function callback(event) {}
// event object
{
action: "SET_DATA", // @see store/actions.ActionTypes
pointer: "#/pointer/location",
parentPointer: "#/pointer",
}
Sends error notifications on changed data.
// create a new data validation service
const validationService = new ValidationService(new State(), jsonSchema)
// called before a next validation
validationService.on("beforeValidation", callback)
// Validation Events bubble up to root pointer (#)
validationService.observe(pointer, callback, true)
// called after notifying observers
validationService.on("afterValidation", callback)
// validate data
validationService.validate(data).then((errors) => {})
FAQs
Json-data manipulation, synchronisation and validation services
The npm package json-data-services receives a total of 14 weekly downloads. As such, json-data-services popularity was classified as not popular.
We found that json-data-services demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.