1.0.4 • Published 8 years ago

dupli v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

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.

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago