1.5.0 • Published 3 years ago
replace-spaces-with-dashes v1.5.0
add-dashes
This is a npm package that will replace all whitespaces in a string with dashes (-).
How to use
- Initialize a node application and create js file:
$ npm init -y
$ touch index.js
- Install this npm package:
$ npm install replace-spaces-with-dashes
- Require this npm package at the top of index.js file as shown in the example below
Example
const replaceSpacesWithDashes = require('replace-spaces-with-dashes');
console.log(replaceSpacesWithDashes("This sentence shouldnt have spaces."));
------- ------ ------ or ------ ------ ------ ------
const {addDashes} = require('replace-spaces-with-dashes');
console.log(addDashes("This sentence shouldnt have spaces.))
$ node index.js
$ > This-sentence-shouldnt-have-spaces.
Notes for myself:
- Make updates to npm package
$ npm version minor
and then
$ npm publish
to update npm package