openexchangerates / accounting.js

A lightweight JavaScript library for number, money and currency formatting - fully localisable, zero dependencies.
http://openexchangerates.github.io/accounting.js
MIT License
4.95k stars 528 forks source link

Convert library to ES6. #87

Open cibernox opened 9 years ago

cibernox commented 9 years ago

I was wondering if there is any plan to convert the library to ES6 modules. I am an ember.js user, and the ember community is quite fond on modularity.

Also, by writing code in ES6 and using a transpiler we can generate all possible versions of the library (globals, commonJS, amd...) without effort, and allow people topick only the funtionalities of the library he is going to use.

If you would consider this, I can make a PR.

jamiebuilds commented 9 years ago

Hey @josscrowcroft, @cibernox is right, there's lot more you can do with es6 modules. You should check out 6to5, with our module formatters. 6to5 also creates very clean and simple output perfect for distributed packages, for an example here's one of my own projects: es6 inputes5 output. I'm a contributor to 6to5, so let me know if you need any help or feel free to drop by our gitter room.

cibernox commented 9 years ago

For the record, I created a ES6 version of accounting.js for using with ember.js ( https://github.com/cibernox/ember-cli-accounting)

It is basically the same code with an index.js file to work as an ember-addon. Also added a few more tests. You might want to read it.

jarben commented 7 years ago

Good stuff @cibernox! Would be nice if there is pure ES6 repo without ember dependency:)