Comparing version 1.0.0 to 1.1.0
@@ -12,3 +12,5 @@ 'use strict'; | ||
result[key] = JSON.parse(value) | ||
try { value = JSON.parse(value) } catch (ex){ } | ||
result[key] = value | ||
}) | ||
@@ -15,0 +17,0 @@ |
{ | ||
"name": "parse-keys", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "JSON.parse only object keys", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# parse-keys | ||
JSON.parse only object keys | ||
## Install | ||
```sh | ||
$ npm i parse--keys --save | ||
``` | ||
## Usage | ||
```js | ||
//server.js | ||
'use strict' | ||
var parse = require('parse-keys'); | ||
var env = parse(process.env, ['PORT']); | ||
console.log(process.env.PORT) === "4000" | ||
//while | ||
console.log(env.PORT) === 4000 | ||
``` | ||
```sh | ||
$ PORT=4000 | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2786
10
29