num-conv-string
This project creates the num-conv-string library in umd format. The library is available in npmjs. The file index.js contains 2 function numToWord() and wordToNum(). The source code for the two functions was copied from https://webpack.js.org/guides/author-libraries/
Installation
- Install node
- run
npm install
Usage
npm run build
to create the library. The library is available in the lib folder.- Use
npm login
,npm publish
andnpm logout
. - For your own library you need to change the name.
- The library is using an external dependency to lodash.
Test of the two built-in functions.
The library can be used with node in the commonjs format. In the test folder are some examples on how to use the library.
numConvStringnumConvString
Testing with the Script Tag in an index.html file
html lang="de">Webpack Library Beispiel - Übersetzung von Zahlen<!-- <script src="https://unpkg.com/num-conv-string"></script> -->
Test with Nodejs
Since the umd format is using a window object, this object has to be provided.
global'window' = {};var numConvString = ;console;
Testing with other projects
There are two test projects for this library:
https://github.com/mbachmann/es6-es5-lib-test https://github.com/mbachmann/num-conv-string-test