Create a package named useless in terminal using:
Import our package using the github link and running the following in terminal:
npm init
Add your function fileconst useless = () => 'you wasted time here!'
module.exports = useless;
Add a file named index.jsconst useless = require('./useless');
module.exports = useless;
Add the entire package to github.USE OUR PACKAGE
Open a new projectImport our package using the github link and running the following in terminal:
npm install VinitK/a-useless-package#master
Create a file named app.js and import the package we created and use it.const useless = require('a-useless-package');
const _ = require('lodash');
console.log(useless());
const truthyArray = _.compact([1, 0, false, '', null, undefined, true, 2, -1, 'true', [], [1, 0], {}, { 'a': 1 }]);
console.log(truthyArray);
That's it!
Comments
Post a Comment