1.0.1 • Published 5 years ago

find-next-file-name v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

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])