ES Module Example
This package demonstrates a simple module example. The sample module contains an exported constant, function, and a class.
Instructions
- On your local machine, create a new directory.
- cd to your new directory.
- Run
npm init
to create apackage.json
file. - Add this package using
npm -i
oryarn add
. - Create a new
index.js
file. - Add this code:
import { coolNum, hello, dx } from 'coderdx-es-module-example'
console.log('Way cool num: ', coolNum)
hello()
const importedClass = new dx
importedClass.printDay()
- In your shell run
node index.js
- In your terminal you should see
$ node index.js
Way cool num: 42
Hello!
The day today is: 29
$