coderdx-es-module-example

1.0.6 • Public • Published

ES Module Example

This package demonstrates a simple module example. The sample module contains an exported constant, function, and a class.

Instructions

  1. On your local machine, create a new directory.
  2. cd to your new directory.
  3. Run npm init to create a package.json file.
  4. Add this package using npm -i or yarn add.
  5. Create a new index.js file.
  6. 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()
  1. In your shell run
    node index.js
  2. In your terminal you should see
$ node index.js
Way cool num:  42
Hello!
The day today is:  29
$

Package Sidebar

Install

npm i coderdx-es-module-example

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

1.44 kB

Total Files

4

Last publish

Collaborators

  • coderdx