node-json-transform is a Node.js utility designed for declaratively transforming and performing operations on JSON data structures. Its last stable release is v1.1.2. The project appears to be abandoned, with no significant updates or releases in the past 8 years. It allows users to define a mapping schema to rename, restructure, and apply operations to JSON objects and arrays. Key features include path-based data retrieval (similar to `lodash.get`), custom functions for data manipulation via `operate` and `each` hooks, default value assignment for missing attributes, and specified attribute removal. It offers both synchronous and asynchronous transformation APIs, making it suitable for various data processing scenarios.
npm install node-json-transformVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates both synchronous and asynchronous JSON transformations, including remapping fields, applying built-in and custom functions, and iterating over each transformed item.
Consider migrating to a more actively maintained JSON transformation library or implement custom transformation logic.
Always use `require()` syntax for importing, e.g., `const { transform } = require('node-json-transform');`.Create a `node-json-transform.d.ts` file with basic type declarations for `transform` and `transformAsync`.
Sanitize or validate transformation maps thoroughly if they originate from untrusted sources. Avoid directly exposing map creation to end-users.
Change `import { transform } from 'node-json-transform';` to `const { transform } = require('node-json-transform');`.Run `npm install node-json-transform` in your project directory.
Ensure `const { transformAsync } = require('node-json-transform');` is used, or access it via `const jsonTransform = require('node-json-transform'); jsonTransform.transformAsync(...)`.No dependency data recorded yet.