A ‘library’ of predefined methods and classes.
Can be imported with require()
, import
and created with export
Making Own Module
- Make a file
my-module.js
and write:
module.exports = {
science : "COOL"
}
- In
index.js
, write:
const myModule = require('./my-module.js')