Skip to content

rahuljain936/JS-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JS modules demo code

This repo is a collection of simple demos of JS modules.

These demos are purposely written in a simple and clear style. You will find no difficulty in following them to learn the basics.

How to use

Live editing and demo on StackBlitz ⚡️

Locally: Clone the repo.

$ git clone https://github.com/rahuljain936/JS-modules.git

Install the dependencies.

$ cd JS-modules
$ npm install

Now, play with the source files under the repo's demo* directories.

$ cd demo0*-**
$ npm run start

Index

  1. Demo01: CommonJS Module
  2. Demo02: ES6 Module
  3. Demo03: CommonJS modules inside ES6 Node Module
  4. Demo04: CommonJS modules inside ES6 Browser Module
  5. Useful links

Demo01: CommonJS Module (source)

$ cd demo01-CJS
$ npm run start

Demo02: ES6 Module (source)

$ cd demo02-ES6
$ npm run start

Demo03: CommonJS modules inside ES6 Node Module (source)

$ cd demo03-ES6-CJS-NODE
$ npm run start

Demo04: CommonJS modules inside ES6 Browser Module (source)

$ cd demo03-ES6-CJS-BROWSER
$ npm run start

Check localhost:1111 in browser

Useful links

License

MIT

Releases

No releases published

Packages

 
 
 

Contributors