3.0.2 • Published 4 years ago

name-on-copy v3.0.2

Weekly downloads
57
License
MIT
Repository
github
Last release
4 years ago

name-on-copy

Codacy Badge MIT License PRs Welcome FOSSA Status lerna

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

ArgumentDescriptionTypeRequired?Default value
sourceName of source i.e. item name being copiedstringrequired''
namesArray of names existing currentlystring[]required[]
options.suffixThe suffix to be used in the name being generatedstringoptional'copy'
options.useSpacesWhen true, a space will be added between source and suffix. When false, no space will be added.booleanoptionalfalse
options.isFileNameWhen true, source will be treated as a filename and file extension will be preserved in generated name. E.g. hello.txt -> hellocopy.txtbooleanoptionalfalse

License

Freely distributed under the terms of the MIT license

FOSSA Status

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.11

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago