Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

find-next-file-name

1.0.1 • Public • Published

find-next-file-name

Add number in parentheses to file name if in specified location a file with given name already exists.

Usage

const findNextFileName = require('find-next-file-name');
 
console.log(findNextFileName(
    "C:/reports/", 
    "lastmonth.pdf"
));

Return example:

$ lastmonth (1).pdf

Installation

$ npm install find-next-file-name

API

findNextFileName(directory[, ?filename[, ?continuCounting]])

Install

npm i find-next-file-name

DownloadsWeekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

5.24 kB

Total Files

8

Last publish

Collaborators

  • avatar