json2module

Convert a JSON object to an ES6 module

Install

All systems
curl cmd.cat/json2module.sh
Debian Debian
apt-get install node-json2module
Ubuntu
apt-get install node-json2module
image/svg+xml Kali Linux
apt-get install node-json2module
Windows (WSL2)
sudo apt-get update sudo apt-get install node-json2module

node-json2module

Convert a JSON object to an ES6 module

For example, given a package.json file and run this through json2module, you’ll get ES6 module as output. 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. Node.js is an event-based server-side JavaScript engine.