0.0.5 • Published 5 years ago
copyright v0.0.5
Copyright
Always up-to-date copyright notices.
Install
npm install copyrightUsage
const copyright = require('copyright');Default
copyright();Copyright © 2020With name
copyright('Christopher Newton');Copyright © 2020 Christopher NewtonWith options
copyright({
startYear: 1981,
endYear: 2081,
name: 'Christopher Newton'
});Copyright © 1981-2081 Christopher NewtonOptions
| property | type | description |
|---|---|---|
name | String | Name to be appended to the copyright notice. |
endYear | Number | Sets the year, or end year when used with startYear. |
startYear | Number | Sets start year and yields a year range (eg. 1977-2020). |
short | Boolean | Omits the leading 'Copyright' word |
htmlEntities | Boolean | Escapes the copyright symbol; ie. © becomes © |
Examples
Name with start year and end year
copyright({
name: 'Christopher Newton',
startYear: 1981,
endYear: 2081
});Copyright © 1981-2081 Christopher NewtonShort with name
copyright({
name: 'Christopher Newton',
short: true
});© 2020 Christopher NewtonEverything
copyright({
name: 'Christopher Newton',
startYear: 1981,
endYear: 2081,
short: true,
htmlEntities: true
});© 1981-2020 Christopher Newton