0.0.16 • Published 6 years ago
dj-hello-world-es v0.0.16
DJ Hello World - ES module
Simple demonstration of packaging for ES Module using single project.
Description
This project attempts to use one source code to distribute multiple packages. This project is compiled for ES Module. For more detail check the github repo.
Using the Package
Before anything we should install the dependencies:
npm i dj-hello-world-es
ES module
Add the following script as type="module"
in a html file.
import { World, Language } from "/node_modules/dj-hello-world-es/index.js";
const newWorld = new World();
newWorld.sayHello();
newWorld.setLanguage(Language.Chinese);
newWorld.sayHello();
Check the printed messages in the console from browser's Developer Tools tab.