A hello world npm module whose main purpose is to experiment a 'modern' (typescript / ES6) module declaration and its consumption by various environments, including legacy.
npm install hello-world-emo
href="https://www.npmjs.com/package/hello-world-emo">
src="https://img.shields.io/npm/v/hello-world-emo.svg">
href="https://david-dm.org/offirmo/offirmo-monorepo?path=4-incubator%2Fhello-world-npm">
src="https://img.shields.io/david/offirmo/offirmo-monorepo.svg?path=4-incubator%2Fhello-world-npm">
href="https://bundlephobia.com/result?p=hello-world-emo">
src="https://img.shields.io/bundlephobia/minzip/hello-world-emo.svg">
href="https://unlicense.org/">
src="https://img.shields.io/badge/license-public_domain-brightgreen.svg">
src="https://img.shields.io/maintenance/yes/2019.svg">
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" hello world, in reference to this article: JavaScript Modules: Welcome to My Emo Hellscape.
``sh`
npm i --save hello-world-emo
yarn add hello-world-emo
`js
import { hello } from 'hello-world-emo'
hello() // --> Hello, World :-(
hello('Offirmo') // --> Hello, Offirmo :-(
``
What did you expect ?
References :
* https://medium.com/@tarkus/how-to-build-and-publish-es6-modules-today-with-babel-and-rollup-4426d9c7ca71#.5pxa9u2l1
* https://ponyfoo.com/articles/why-i-write-plain-javascript-modules
* http://www.2ality.com/2015/12/bundling-modules-future.html
* https://www.smashingmagazine.com/2016/02/writing-next-generation-reusable-javascript-modules/
* https://medium.com/@mweststrate/how-to-create-strongly-typed-npm-modules-1e1bda23a7f4#.74ko6tal3