
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
transcribe-json
Advanced tools
npm install transcribe-json
Three basic functions:
import { read, extract, write } from "transcribe-json";
read is async and returns the JSON file content as an object.extract returns a function that extracts fields from any object (only top-level fields can be specified).write returns an async function that write an object to a file in JSON, ES Module or CommonJS.You can combine them as follows:
// just read and use it as you like later
const content = await read(srcfile);
// copy all fields to another file
read(srcfile).then(write(outfile));
// extract some fields
read(srcfile).then(extract(fields)).then(write(outfile));
// insert any callback to convert an object to another
read(srcfile).then(convert).then(write(outfile));
There are also some options for write():
write(outfile, {
replacer: null, // used in JSON.stringify()
space: " ", // used in JSON.stringify()
filetype: "json", // "json", "mjs" or "cjs"
formatter: (code, filetype) => code, // any formatting function
});
If filetype === "mjs", the result will be a default export.
export default {
"name": "transcribe-json",
"version": "0.1.0-alpha"
};
Use transcribe-json command.
Command:
transcribe-json [options] <input filepath>
transcribe-json <-h|--help|-v|--version>
Options:
--outfile <path> The output filepath with or without extension. (required)
--type <type> The filetype to emit. Either json, mjs or cjs. (optional)
--fields <names> Top-level field names to extract. Comma separated. (optional)
For example in your package.json:
{
"scripts": {
"pkg": "transcribe-json package.json --outfile package-info.js --type mjs --fields name,version"
}
}
FAQs
From JSON file to object. Extract any fields. From object to JS/JSON file.
The npm package transcribe-json receives a total of 0 weekly downloads. As such, transcribe-json popularity was classified as not popular.
We found that transcribe-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.