Comparing version 1.1.4 to 2.0.0
#!/usr/bin/env node | ||
const nodeVersionMatches = require('node-version-matches') | ||
/* v8.9.0 required for passing custom paths to require.resolve() */ | ||
if (nodeVersionMatches('>=8.9.0')) { | ||
@@ -4,0 +5,0 @@ const CliApp = require('../lib/cli-app') |
const nodeVersionMatches = require('node-version-matches') | ||
/* v8.9.0 required for passing custom paths to require.resolve() */ | ||
if (!nodeVersionMatches('>=8.9.0')) { | ||
@@ -21,3 +22,3 @@ const chalk = require('chalk') | ||
* A synchronous method to rename files in bulk. | ||
* | ||
* | ||
* @param {object} options - The renamer options | ||
@@ -24,0 +25,0 @@ * @param {string[]} [options.files] - One or more glob patterns or filenames to process. |
@@ -16,3 +16,3 @@ const cliOptions = require('../lib/cli-options') | ||
}, | ||
paths: [ path.resolve(__dirname, 'plugin'), '.', globalModules ], | ||
paths: [path.resolve(__dirname, 'plugin'), '.', globalModules], | ||
prefix: 'renamer-' | ||
@@ -19,0 +19,0 @@ }) |
@@ -34,3 +34,3 @@ exports.optionDefinitions = [ | ||
plugin: true, | ||
defaultValue: [ 'default', 'index' ] | ||
defaultValue: ['default', 'index'] | ||
}, | ||
@@ -37,0 +37,0 @@ { |
@@ -42,3 +42,3 @@ module.exports = PluginBase => class Default extends PluginBase { | ||
} | ||
} else if ([ 'name', 'ext' ].includes(element)) { | ||
} else if (['name', 'ext'].includes(element)) { | ||
file[element] = file[element].replace(find, replace) | ||
@@ -45,0 +45,0 @@ const basename = file.name + file.ext |
@@ -6,3 +6,3 @@ class Replacer { | ||
pluginNames = arrayify(pluginNames) | ||
this.plugins = util.loadPlugins(pluginNames.length ? pluginNames : [ 'default', 'index' ]) | ||
this.plugins = util.loadPlugins(pluginNames.length ? pluginNames : ['default', 'index']) | ||
} | ||
@@ -9,0 +9,0 @@ |
@@ -61,3 +61,3 @@ /** | ||
createPlugin = loadModule(pluginName, { | ||
paths: [ path.resolve(__dirname, 'plugin'), '.', globalModules ], | ||
paths: [path.resolve(__dirname, 'plugin'), '.', globalModules], | ||
prefix: 'renamer-' | ||
@@ -64,0 +64,0 @@ }) |
{ | ||
"name": "renamer", | ||
"description": "Rename files in bulk", | ||
"version": "1.1.4", | ||
"version": "2.0.0", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
@@ -9,3 +9,3 @@ "bin": "bin/cli.js", | ||
"engines": { | ||
"node": ">=8.9.0" | ||
"node": ">=10" | ||
}, | ||
@@ -33,26 +33,26 @@ "repository": "https://github.com/75lb/renamer", | ||
"dependencies": { | ||
"array-back": "^4.0.0", | ||
"chalk": "^2.4.2", | ||
"array-back": "^4.0.1", | ||
"chalk": "^4.0.0", | ||
"command-line-args": "^5.1.1", | ||
"command-line-plugin": "^0.2.0", | ||
"command-line-usage": "^6.0.2", | ||
"command-line-usage": "^6.1.0", | ||
"fast-diff": "^1.2.0", | ||
"glob": "^7.1.5", | ||
"glob": "^7.1.6", | ||
"global-modules": "^2.0.0", | ||
"load-module": "^2.0.2", | ||
"node-version-matches": "^1.0.1", | ||
"load-module": "^3.0.0", | ||
"node-version-matches": "^2.0.1", | ||
"printj": "^1.2.2", | ||
"reduce-flatten": "^3.0.0", | ||
"reduce-unique": "^2.0.1", | ||
"stream-read-all": "^2.0.0", | ||
"typical": "^5.2.0" | ||
"stream-read-all": "^3.0.0", | ||
"typical": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.7", | ||
"jsdoc-to-markdown": "^5.0.2", | ||
"coveralls": "^3.0.11", | ||
"jsdoc-to-markdown": "^5.0.3", | ||
"mkdirp2": "^1.0.4", | ||
"nyc": "^14.1.1", | ||
"rimraf": "^3.0.0", | ||
"test-runner": "^0.6.0" | ||
"nyc": "^15.0.1", | ||
"rimraf": "^3.0.2", | ||
"test-runner": "^0.8.13" | ||
} | ||
} |
@@ -104,2 +104,4 @@ [![view on npm](http://img.shields.io/npm/v/renamer.svg)](https://www.npmjs.org/package/renamer) | ||
© 2012-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown). | ||
© 2012-20 Lloyd Brookes \<75pound@gmail.com\>. | ||
Tested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown). |
Sorry, the diff of this file is not supported yet
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
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
25246
499
107
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedload-module@3.0.0(transitive)
+ Addednode-version-matches@2.0.1(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedstream-read-all@3.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtypical@6.0.1(transitive)
- Removednode-version-matches@1.0.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedstream-read-all@2.0.0(transitive)
Updatedarray-back@^4.0.1
Updatedchalk@^4.0.0
Updatedcommand-line-usage@^6.1.0
Updatedglob@^7.1.6
Updatedload-module@^3.0.0
Updatednode-version-matches@^2.0.1
Updatedstream-read-all@^3.0.0
Updatedtypical@^6.0.0