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

node-dev

Package Overview
Dependencies
Maintainers
4
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-dev - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

4

CHANGELOG.md
# node-dev
## v6.1.0 / 2020-10-15
- Manually wrangle node args so that we can handle `--` args coming before `-` args (Fixes #236)
## v6.0.0 / 2020-10-14

@@ -4,0 +8,0 @@

30

lib/cli.js

@@ -12,14 +12,18 @@ const minimist = require('minimist');

const doubleDash = s => /^--/.test(s);
const dash = s => /^-[^-]*$/.test(s);
function getFirstNonOptionArgIndex(args) {
for (let i = 2; i < args.length; i += 1) {
if (args[i][0] != '-') return i;
if (!doubleDash(args[i]) && !dash(args[i]) && !dash(args[i - 1] || '')) return i;
}
return args.length;
return args.length - 1;
}
module.exports = argv => {
const nodeArgs = [];
const unknownArgs = [];
const scriptIndex = getFirstNonOptionArgIndex(argv);
const script = argv[scriptIndex];

@@ -33,11 +37,21 @@ const scriptArgs = argv.slice(scriptIndex + 1);

default: getConfig(script),
unknown: function (arg) {
const argKeys = Object.keys(minimist([arg]));
unknown: arg => {
const key = Object.keys(minimist([arg]))[1];
if (configKeys.some(k => argKeys.includes(k))) {
return true;
if (!configKeys.includes(key)) {
unknownArgs.push({ arg, key });
}
}
});
nodeArgs.push(arg);
const nodeArgs = unknownArgs.reduce((out, { arg, key }) => {
out.push(arg);
if (typeof opts[key] !== 'boolean' && !arg.includes('=')) {
out.push(opts[key]);
}
return out;
}, []);
unknownArgs.forEach(({ key }) => {
delete opts[key];
});

@@ -44,0 +58,0 @@

{
"name": "node-dev",
"version": "6.0.0",
"version": "6.1.0",
"description": "Restarts your app when files are modified",

@@ -5,0 +5,0 @@ "keywords": [

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