3.0.2 • Published 3 years ago
name-on-copy v3.0.2
name-on-copy
Generate new names on copy.
Installation
$ npm i name-on-copy
# or
$ yarn add name-on-copy
Usage
import nameOnCopy from 'name-on-copy'
// or
const nameOnCopy = require('name-on-copy').default
nameOnCopy('hello', ['hello'])
// hellocopy
nameOnCopy('hello', ['hello', 'hellocopy'])
// hellocopy2
nameOnCopy('world', ['hello', 'hellocopy', 'world'])
// worldcopy
API
Syntax
nameOnCopy(source, names [, options])
Arguments
Argument | Description | Type | Required? | Default value |
---|---|---|---|---|
source | Name of source i.e. item name being copied | string | required | '' |
names | Array of names existing currently | string[] | required | [] |
options.suffix | The suffix to be used in the name being generated | string | optional | 'copy' |
options.useSpaces | When true , a space will be added between source and suffix . When false , no space will be added. | boolean | optional | false |
options.isFileName | When true , source will be treated as a filename and file extension will be preserved in generated name. E.g. hello.txt -> hellocopy.txt | boolean | optional | false |
License
Freely distributed under the terms of the MIT license
3.0.2
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.0.0
3 years ago
1.2.5
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.2.0
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.1.2
3 years ago
1.0.11
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.2
3 years ago
1.0.3
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago