Skip to content

how to transpile newer Javascript code for ECMAScript 5.1 #245

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

Open
mr-c opened this issue Sep 2, 2022 · 0 comments
Open

how to transpile newer Javascript code for ECMAScript 5.1 #245

mr-c opened this issue Sep 2, 2022 · 0 comments

Comments

@mr-c
Copy link
Member

mr-c commented Sep 2, 2022

One recipe is to use
https://babeljs.io/

$ npm install -G @babel/core @babel/cli @babel/preset-env
$ babel --presets  @babel/preset-env some_javascript.js > some_javascript_es5.1.js

or

$ sudo apt install babeljs
$ babeljs --presets /usr/share/nodejs/@babel/preset-env/ underscore-esm-min.js some_javascript.js > some_javascript_es5.1.js

You may need to insert var exports = new Object(); after the "use strict"; at the top of the output.

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

No branches or pull requests

1 participant