https://github.com/ksxnodeapps/require-to-json
Require a JavaScript file and print JSON result to stdout
https://github.com/ksxnodeapps/require-to-json
cli eval javascript json nodejs npm
Last synced: 4 months ago
JSON representation
Require a JavaScript file and print JSON result to stdout
- Host: GitHub
- URL: https://github.com/ksxnodeapps/require-to-json
- Owner: ksxnodeapps
- License: mit
- Created: 2017-04-08T13:40:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-23T09:46:50.000Z (over 8 years ago)
- Last Synced: 2025-02-01T14:15:34.455Z (over 1 year ago)
- Topics: cli, eval, javascript, json, nodejs, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/require-to-json
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# require-to-json
Require a JavaScript file and print JSON result to stdout
## Installation
```bash
npm install --global require-to-json
```
## Command-line usage
```bash
require-to-json file.js
```
```bash
require-to-json < file.js
```
```bash
cat file.js | require-to-json
```
```bash
echo 'module.exports = 123 + 456' | require-to-json
```