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

dupli

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dupli

get the next duplicate (file-)name providing some kind of simple naming pattern and existing entries + counter

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

dupli

get the next duplicate (file-)name providing some kind of simple naming pattern and existing entries + counter

install

$ npm install dupli --save

usage

dupli(String, Array, String);

const newName = dupli('copy 1 new document', [], 'copy');
// newName: copy 2 new document

const newName = dupli('new document', ['copy 2 new document', 'copy 1 new document'], 'copy');
// newName: copy 3 new document

note

please note, the array of files is only used to get the highest number, the string which follows copy 2 for example is not taken in account to match the original filename passed as the first argument. You could as well just pass copy 2, copy 3, the idea here is that the array is an array of filenames which are already duplicates of the same file which gets duplicated using dupli.

Thats due to the necesity of this module, if you need it to be taken into account just fork and add an option and merge back if you like.

FAQs

Package last updated on 11 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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