55
loading...
This website collects cookies to deliver better user experience
mkdir astro-static-tweet && cd astro-static-tweet
npm init
my-plugin
, but chances are it's already taken.npm search
command to see if your name is still valid.@username/my-plugin
, making it pretty unique.index.js
file and add the following code.function add(one, two) {
return one + two;
}
module.exports = add;
const add = require('plugin-name');
console.log(add(2, 5));
function add(one, two) {
return one + two;
}
function subtract(one, two) {
return one - two;
}
function multiply(one, two) {
return one * two;
}
module.exports = {add, subtract, multiply};
const {add, subtract, multiply} = require('plugin-name');
npm link
npm link your-package-name
npm login
npm publish
npm publish --access=public
1
: Major change can have incompatible function changes2
: Minor change, mostly backward compatible3
: Patch change, bugfix for instancenpm publish
# OR IF YOU SCOPED YOUR PACKAGE:
npm publish --access=public