Member-only story
How to create your own module
2 min readAug 12, 2021
This is a tutorial on creating your own node module.
You can also read this website
Create a new module
- Creating a folder
mkdir folder-name
2. Creating package.json file with the following command
npm init
This utility will walk you through creating a package.json file.
package name: (the name of your module)
version: (1.0.0) /** default **/
description: description of your module
entry point: (index.js)
test command:
git repository: your git repository URL
keywords: keyword people search for
author: name <email@gmail.com> (your website)
license: (ISC)
3. Creating your own module
Maybe you already have files, so just copy and paste them.
exports.functionName = function() {
/* processing */
}
4. Creating and adding a README.md file to a package
touch README.md
You can add the description of your module.
5. Publish your module
npm publish
Update the module
- Edit your module