Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Webpack instead of Grunt; add a standalone version without locales; #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mtkcs
Copy link

@mtkcs mtkcs commented Oct 4, 2019

This PR fixes issue #43, no breaking changes were introduced.

The changes

  • Replaced Grunt with Webpack
  • Extracted the main logic into core.js file
  • Created a new file lib/standalone.js that exposes the main functionality of the library without including all the locale files
  • For the standalone version no locales were added, so the user have to import/create a locale object ( even for english ).
  • Generated dist/written-number.standalone.js and dist/written-number.standalone.min.js
  • Copied the i18n folder to the dist folder at build time
  • Example usage:
import fr from 'lib/i18n/fr.json';
import writtenNumber from 'lib/standalone.js';
writtenNumber(1234, {lang: 'fr'});  // => 'mille deux cent trente-quatre'

// or
writtenNumber.defaults.lang = fr;
writtenNumber(1234);  // => 'mille deux cent trente-quatre'

@coveralls
Copy link

coveralls commented Oct 4, 2019

Coverage Status

Coverage increased (+0.2%) to 99.213% when pulling 0013769 on mtkcs:modular-locales into aec43a3 on yamadapc:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 99.213% when pulling 2845cee on mtkcs:modular-locales into aec43a3 on yamadapc:master.

@TylerVigario
Copy link

TylerVigario commented Mar 2, 2020

Why hasn't this been merged yet? This can drastically optimize the size of this library. I use this library in a library I have made (Mass.js) and would love to reduce the cost of including it.

@forzagreen
Copy link
Collaborator

Hi @MeekLogic , I am working on a new library for converting numbers to letters: https://github.com/forzagreen/n2words
It's supporting 15 languages and still growing. Feel free to contribute.

@p3x-robot
Copy link
Contributor

Hi @MeekLogic , I am working on a new library for converting numbers to letters: https://github.com/forzagreen/n2words
It's supporting 15 languages and still growing. Feel free to contribute.

no support for hungarian :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants