
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.
json2module
Advanced tools
Convert a JSON object into an ES6 module. For example, given a package.json file:
{
"name": "hello-world",
"version": "0.0.1"
}
If you run this through json2module like so:
json2module < package.json
You’ll get the following ES6 module as output:
export var name = "hello-world";
export var version = "0.0.1";
This is particularly useful for exporting a version number defined in your package.json file when using Rollup. Unlike rollup-plugin-json, which enables Rollup to parse JSON directly, json2module creates standard ES6 modules that can be consumed by any client.
FAQs
Convert a JSON object to an ES6 module.
The npm package json2module receives a total of 125,398 weekly downloads. As such, json2module popularity was classified as popular.
We found that json2module 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
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.