Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@danmasta/interpolate

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@danmasta/interpolate - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

4

bin/envstr.js

@@ -11,3 +11,3 @@ #!/usr/bin/env node

--string -s - Text string to parse
--stdin - Read input from stdin
--stdin - - Read input from stdin
--json -j - Handle input as json

@@ -31,3 +31,3 @@ --key -k - If input is json, parse data at specified key

string: 's',
stdin: null,
stdin: '-',
json: 'j',

@@ -34,0 +34,0 @@ key: 'k',

@@ -14,3 +14,3 @@ #!/usr/bin/env node

--string -s - Text string to parse
--stdin - Read input from stdin
--stdin - - Read input from stdin
--env -e - If true will also interpolate from envrionment variables

@@ -37,3 +37,3 @@ --params -p - Stringified json object, or string of key,value pairs: key1=1,key2=2

string: 's',
stdin: null,
stdin: '-',
env: 'e',

@@ -40,0 +40,0 @@ params: 'p',

@@ -25,3 +25,22 @@ const minimist = require('minimist');

let argv = _.transform(minimist(process.argv.slice(2)), (res, val, key) => {
res[_.camelCase(key)] = toNativeType(val);
val = toNativeType(val);
// Support '-' arg for stdin
if (key === '_') {
if (val[0] === '-') {
res['-'] = true;
val.shift();
}
if (val.length) {
res[key] = val;
}
} else {
if (val === '-') {
res['-'] = true;
val = true;
}
res[_.camelCase(key)] = val;
}
});

@@ -28,0 +47,0 @@

{
"name": "@danmasta/interpolate",
"version": "0.0.12",
"version": "0.0.13",
"author": "Daniel Smith <dannmasta@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Simple string interpolation helper",

@@ -32,3 +32,3 @@ # Interpolate

`string` | s | *`string`* | Text string to parse. Default is `undefined`
`stdin` | | *`boolean`* | Read input from stdin. Default is `false`
`stdin` | - | *`boolean`* | Read input from stdin. Default is `false`
`env` | e | *`boolean`* | If true will also interpolate with environment variables. Default is `false`

@@ -57,3 +57,3 @@ `params` | p | *`object\|string`* | Object of key,value pairs to use for parameter matching. If string, it should either be a stringified json object, or a comma-separated key,value list: `"key1=1,key2=2"`. Default is `undefined`

`string` | s | *`string`* | Text string to parse. Default is `undefined`
`stdin` | | *`boolean`* | Read input from stdin. Default is `undefined`
`stdin` | - | *`boolean`* | Read input from stdin. Default is `undefined`
`json` | j | *`boolean`* | Handle input as json. Default is `false`

@@ -60,0 +60,0 @@ `key` | k | *`string`* | If input is json, parse data at specified key. Default is `undefined`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc