NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/json2module/README.md
2023-09-14 14:47:11 +08:00

26 lines
704 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# json2module
Convert a JSON object into an ES6 module. For example, given a package.json file:
```json
{
"name": "hello-world",
"version": "0.0.1"
}
```
If you run this through json2module like so:
```json
json2module < package.json
```
Youll get the following ES6 module as output:
```js
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](http://rollupjs.org/). Unlike [rollup-plugin-json](https://github.com/rollup/rollup-plugin-json), which enables Rollup to parse JSON directly, json2module creates standard ES6 modules that can be consumed by any client.