Skip to content
A real npm module whose main purpose is to experiment a "modern" (typescript / ES6) module declaration and its consumption by various environments, including legacy.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
scripts
src
test
.bithoundrc
.editorconfig
.gitignore
.nvmrc
CHANGELOG.md
LICENSE
NOTES.md
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

Hello World Emo

NPM version license

A hello world npm module whose real purpose is to experiment a 'modern' (typescript / ES6) module declaration and its consumption by various environments, including legacy.

This is an "emo" version, in reference to this article: JavaScript Modules: Welcome to My Emo Hellscape.

installation

npm i --save hello-world-emo

Then in your code:

  • node 6+ : const { hello } = require('hello-world-emo')
  • node stable (4): const hello = require('hello-world-emo').hello
  • node legacy (<4): var hello = require('hello-world-emo/dist/index.node-legacy').hello
  • ES2015/ES6: import { hello } from 'hello-world-emo'
    • a "jsnext" entry is provided in package.json for rollup users, pointing to ES6 code
  • typescript: import { hello } from 'hello-world-emo'
  • browser
    • TODO

Usage

hello()           --> Hello, World :-(
hello('Offirmo')  --> Hello, Offirmo :-(

What did you expect ?

Contributing

npm 3 is needed for installing deps (node >= 6)

rm -rf node_modules
npm i

tests (node >= 6)

npm run test:quick
npm run test:interactive

Then switch back to the lowest non-legacy node we want to officially support (earlier will be "legacy") for generating

nvm use 4
npm run build

Eventually, commit and release

npm run np -- patch

Technical

This module is aiming at having optimal consumption by :

References :

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.