https://github.com/rookiemonkey/boilerplate-nodepackage
:wrench: :hammer: Boilerplate in creating own node package (not using ES6/7 yet)
https://github.com/rookiemonkey/boilerplate-nodepackage
boilerplate template
Last synced: over 1 year ago
JSON representation
:wrench: :hammer: Boilerplate in creating own node package (not using ES6/7 yet)
- Host: GitHub
- URL: https://github.com/rookiemonkey/boilerplate-nodepackage
- Owner: rookiemonkey
- Created: 2020-07-25T00:25:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-25T05:41:08.000Z (almost 6 years ago)
- Last Synced: 2025-02-08T12:12:55.750Z (over 1 year ago)
- Topics: boilerplate, template
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
This is a template for me to create my own npm packages
### Installation
`npm i --save jsuse`
```
import helpers from 'jsuse';
console.log(helpers)
// returns an object of functions depending on their use
{
basics: {
greet: [Function: greet],
introduce: [Function: introduce]
},
basicsAgain: {
greetAgain: [Function: greetAgain],
introduceAgain: [Function: introduceAgain]
}
}
import helpers from 'jsuse';
const { basics } = helpers;
const { basicsAgain } = helpers;
console.log(basics.greet('Kevin'))
console.log(basics.introduce())
console.log(basicsAgain.greetAgain('Kevin'))
console.log(basicsAgain.introduceAgain())
```
### Setup
for node.js version <= v12
Save the file with ES6 modules with .mjs extension and run it like
```
node --experimental-modules my-app.mjs
```
for node.js version >= v13
You need to either:
1. Save the file with .mjs extension, or
2. Add { "type": "module" } on your package.json file.