Turn your ES5 code into readable ES6. Lebab does the opposite of what Babel does.

Overview

Build Status Coverage Status Dependencies License Version

Lebab

Lebab

Lebab transpiles your ES5 code to ES6/ES7. It does exactly the opposite of what Babel does. If you want to understand what Lebab exactly does, try the live demo.

Install

Install it using npm:

$ npm install -g lebab

Full build:

Usage

Convert your old-fashioned code using the lebab cli tool, enabling a specific transformation:

$ lebab es5.js -o es6.js --transform let

Or transform an entire directory of files in-place:

# .js files only
$ lebab --replace src/js/ --transform arrow
# For other file extensions, use explicit globbing
$ lebab --replace 'src/js/**/*.jsx' --transform arrow

For all the possible values for --transform option see the detailed docs below or use --help from command line.

Features and known limitations

The recommended way of using Lebab is to apply one transform at a time, read what exactly the transform does and what are its limitations, apply it for your code and inspect the diff carefully.

Safe transforms

These transforms can be applied with relatively high confidence. They use pretty straight-forward and strict rules for changing the code. The resulting code should be almost 100% equivalent of the original code.

  • arrow - callbacks to arrow functions
    • Converts bound functions like function(){}.bind(this)
    • not applied to unbound functions that use this
    • not applied to functions that use arguments
    • not applied to object properties (use obj-method transform)
    • does not remove that = this assignments
  • arrow-return - drop return statements in arrow functions
    • converts immediate return { return x; } to => x
    • applies to arrow functions and nested arrow functions
    • LIMITATION only applies to arrow functions (run the arrow transform first)
  • for-of - for loop to for-of loop
  • for-each - for loop to Array.forEach()
  • arg-rest - use of arguments to function(...args)
  • arg-spread - use of apply() to spread operator
    • recognizes obj.method.apply(obj, args)
    • recognizes func.apply(undefined, args)
  • obj-method - function values in object to methods
  • obj-shorthand - {foo: foo} to {foo}
    • ignores numeric and NaN properties
    • does not convert string properties
  • no-strict - removal of "use strict" directives
    • does not touch stuff like x = "use strict";
  • exponent - Math.pow() to ** operator (ES7)
    • Full support for all new syntax from ES7
  • multi-var - single var x,y; declaration to multiple var x; var y; (refactor)

Unsafe transforms

These transforms should be applied with caution. They either use heuristics which can't guarantee that the resulting code is equivalent of the original code, or they have significant bugs which can result in breaking your code.

  • let - var to let/const
  • class - function/prototypes to classes
  • commonjs - CommonJS module definition to ES6 modules
    • converts var foo = require("foo") to import foo from "foo"
    • converts var bar = require("foo").bar to import {bar} from "foo"
    • converts var {bar} = require("foo") to import {bar} from "foo"
    • converts module.exports = <anything> to export default <anything>
    • converts exports.foo = function(){} to export function foo(){}
    • converts exports.Foo = class {} to export class Foo {}
    • converts exports.foo = 123 to export var foo = 123
    • converts exports.foo = bar to export {bar as foo}
    • LIMITATION does not check if named export conflicts with existing variable names
    • LIMITATION Ignores imports/exports inside nested blocks/functions
    • LIMITATION only handles require() calls in var declarations
    • LIMITATION does not ensure that imported variable is treated as const
    • LIMITATION does not ensure named exports are imported with correct ES6 syntax
  • template - string concatenation to template strings
  • default-param - default parameters instead of a = a || 2
  • destruct-param - use destructuring for objects in function parameters
  • includes - array.indexOf(foo) !== -1 to array.includes(foo) (ES7)
    • works for both strings and arrays
    • converts !== -1 to array.includes(foo)
    • converts === -1 to !array.includes(foo)
    • recognizes all kinds of comparisons >= 0, > -1, etc
    • recognizes both indexOf() != -1 and -1 != indexOf()
    • LIMITATION does not detect that indexOf() is called on an actual Array or String.

Programming API

Simply import and call the transform() function:

import {transform} from 'lebab';
const {code, warnings} = transform(
  'var f = function(a) { return a; };', // code to transform
  ['let', 'arrow', 'arrow-return'] // transforms to apply
);
console.log(code); // -> "const f = a => a;"

The warnings will be an array of objects like:

[
  {line: 12, msg: 'Unable to transform var', type: 'let'},
  {line: 45, msg: 'Can not use arguments in arrow function', type: 'arrow'},
]

Most of the time there won't be any warnings and the array will be empty.

Editor plugins

Alternatively one can use Lebab through plugins in the following editors:

What's next?

Which feature should Lebab implement next? Let us know by creating an issue or voicing your opinion in existing one.

Want to contribute? Read how Lebab looks for patterns in syntax trees.

Comments
  • Error

    Error "Only one instance of babel-polyfill is allowed" when using Lebab as library

    HI Guys,

    While trying to use your tool in the browser with browserify I got sometimes errors:

    only one instance of babel-polyfill is allowed

    Any idea why? I just simply use the following code and sometimes it works and sometimes I got this error ...

    var lebab = require('lebab'); const {code, warnings} = lebab.transform(es5Code);

    Have you tried the latest version with browserify ? any hint how can I avoid this new instance creation ?

    I saw that this error is coming from .../node_modules/babel-polyfill/lib/index.js line10 .

    Can I remove somehow the babel polyfill before Im calling your code since not sure from where it's coming...i'm not using babel...

    Thanks

    bug 
    opened by jhonJerb 18
  • Add support for forEach transformation

    Add support for forEach transformation

    This adds support for transforming simple for loops into forEach loops #188.

    This builds on the code for transforming for loops into for-each loops and refactors the code to share as much as possible.

    This code adds the index and array as required.

    To simplifiy the transformation of old code by allowing the author to name the loop variable at the start of the code and then lebab will do this rewriting in the rest of the loop.

    So, taking the example from #169.

    for (let i = 0; i < fruits.length; i++) {
       let fruitItem = fruits[i];
       console.log(fruits[i]);
    }
    // -->
    fruits.forEach(fruitItem => {
       console.log(fruitItem);
    });
    

    or a more complicated example

    for (let i = 0; i < xs.length; i++) {
      const x = xs[i];
      console.log(xs[i]);
      for (let j = 0; j < xs[i].length; j++) {
        const y = xs[i][j];
        console.log(xs[i][j]);
      }
    }
    // -->
    xs.forEach(x => {
      console.log(x);
      x.forEach(y => {
        console.log(y);
      });
    });
    
    opened by aboyton 12
  • Lebab Live editor

    Lebab Live editor

    Seems like https://lebab.io/try-it is not updated and @nene do not have access to this, so in case people want to try out the latest Lebab version without installing it on their machines, I created this

    Lebab - Community Editor - You can view the source here Source

    It uses the latest version of Lebab, If Lebab updates, this also automatically fetches and updates. So it will always be up to date.

    Main Features:

    • Customizable Options. You can choose which Lebab options you like to test.
    • Optional Minify and Transpile using Babel and Babili.

    Fork,Clone,Download:

    • You can simply fork the repo and use it directly using Github pages.
    • You can also Clone it to your own server and run it just like a regular website.
    • You may download the repo locally, but it must be ran on a local webserver such as wamp for windows and the likes.

    Tested on: FF - 54.0.1 Chrome - 59.0

    Note** Since the code uses webworkers, it must be ran on a web server since modern browsers will not allow you to run a web worker locally.

    opened by uniibu 10
  • Is Lebab a tool for real world?

    Is Lebab a tool for real world?

    Consider I have a very simple code using a namespace to bundle functionality under a name. I try to turn this code to ES6 using Lebab and I expect to see some classes but it seems Lebab fails to transpile this code (I saw this is a known issue #113 ).

    Namespaces are a very common pattern, so what is the goal of using this kind of tools when they fail to provide new modern features of ES? I think very basic operations like changing var to const, removing "use strict" directives and etc. are not enough to use these kind of tools to transpile a real code. This not the only snag or limitation, consider a ES6 Code without Reflection, Proxying and etc..

    **` var Bamblip = { Message: ' ', };

    Bamblip.Init = function() { Bamblip.Message = 'Hello '; };

    Bamblip.Welcome = function(name) { Bamblip.Init(); alert(Bamblip.Message + name) }

    Bamblip.Welcome('Bamblip'); `**

    opened by Bamblip 10
  • Replaced file contains CRLF on Windows

    Replaced file contains CRLF on Windows

    When I replace a file, it will be written with CRLF line endings on Windows. This is annoying in itself but especially noteworthy because the source file has LF line endings.

    opened by oliversalzburg 9
  • Possible merge with 5to6?

    Possible merge with 5to6?

    5to6 project has same goals and list of other transformations, while xto6 supports only class transformation. My thought is that both projects would benefit from merge or collaboration.

    /cc @thomasloh @benjamn

    enhancement 
    opened by RReverser 9
  • Get the lebab library

    Get the lebab library

    HI,

    I use lebab for testing purpose in JSfiddle, there I put the reference https://rawgit.com/hugeen/lebab-experiment/master/lebab.js

    but it doesn' t parse the code as expected, for example arrow function are not working but if I test the same file in the playground you have provided it working as expected ...

    1. Does this library is up to date ?
    2. if I want to download the minified up-to-data version from this repo,is it possible ?if yes which file should I use

    Thanks!

    opened by JenneyJ 8
  • Add code coverage using NYC and integrate with codecov

    Add code coverage using NYC and integrate with codecov

    • Closes #212
    • Add code coverage using NYC
    • Separate out system tests from the unit test
    • Add scripts:
      • npm run cover: To check coverage locally
      • npm run system-test: To run system test
      • npm run check-coverage: To check and ensure that coverage is above 80%
      • npm run report-coverage: To create .lcov based code coverage report
      • npm run codecov: To upload code coverage report to codecov
    • Update .travis.yml to add the scripts to be executed at right build life-cycle events
    opened by addityasingh 8
  • Add code coverage using NYC and integrate with codecov

    Add code coverage using NYC and integrate with codecov

    • [x] Add code coverage metrics for lebab
    • [x] Integrate with codecov to push code coverage data to codecov

    Example:

    screen shot 2017-01-19 at 9 33 39 am

    Sample Reference: https://github.com/addi90/build-notification-api/blob/master/package.json#L9

    opened by addityasingh 7
  • Unable to convert code containing JSX

    Unable to convert code containing JSX

    We are using React (v15.10) and JSX and are trying to upgrade our code from ES5.1 (?) to ES6. In our pure js files, we have been able to run lebab successfully, but for anything with JSX (embedded HTML), we get an error similar to the following:

    `➜ mixins lebab BootstrapTableMixins.js

    /usr/local/lib/node_modules/lebab/node_modules/recast/node_modules/esprima/esprima.js:5701 throw e; ^ Error: Line 54: Unexpected token < at constructError (/usr/local/lib/node_modules/lebab/node_modules/recast/node_modules/esprima/esprima.js:2406:21) at createError (/usr/local/lib/node_modules/lebab/node_modules/recast/node_modules/esprima/esprima.js:2425:17) `

    How difficult would be to adapt the currently implementation to support JSX-containing files? I think all that we would want here is for it to keep such as expressions as-is instead of throwing an error.

    enhancement 
    opened by nickmcummins 7
  • Lodash cherry-picking

    Lodash cherry-picking

    It would be nice if you could atleast cherry pick lodash functions that you specifically use. It would make install faster and build smaller.

    Example import forEach from 'lodash/forEach'

    opened by uniibu 6
  • Bump flat and mocha

    Bump flat and mocha

    Bumps flat to 5.0.2 and updates ancestor dependency mocha. These dependencies need to be updated together.

    Updates flat from 4.1.0 to 5.0.2

    Commits
    • e5ffd66 Release 5.0.2
    • fdb79d5 Update dependencies, refresh lockfile, format with standard.
    • e52185d Test against node 14 in CI.
    • 0189cb1 Avoid arrow function syntax.
    • f25d3a1 Release 5.0.1
    • 54cc7ad use standard formatting
    • 779816e drop dependencies
    • 2eea6d3 Bump lodash from 4.17.15 to 4.17.19
    • a61a554 Bump acorn from 7.1.0 to 7.4.0
    • 20ef0ef Fix prototype pollution on unflatten
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by timoxley, a new releaser for flat since your current version.


    Updates mocha from 6.1.4 to 10.2.0

    Release notes

    Sourced from mocha's releases.

    v10.2.0

    10.2.0 / 2022-12-11

    :tada: Enhancements

    • #4945: API: add possibility to decorate ESM name before import (@​j0tunn)

    :bug: Fixes

    :book: Documentation

    v10.1.0

    10.1.0 / 2022-10-16

    :tada: Enhancements

    :nut_and_bolt: Other

    v10.0.0

    10.0.0 / 2022-05-01

    :boom: Breaking Changes

    :nut_and_bolt: Other

    ... (truncated)

    Changelog

    Sourced from mocha's changelog.

    10.2.0 / 2022-12-11

    :tada: Enhancements

    • #4945: API: add possibility to decorate ESM name before import (@​j0tunn)

    :bug: Fixes

    :book: Documentation

    10.1.0 / 2022-10-16

    :tada: Enhancements

    :nut_and_bolt: Other

    10.0.0 / 2022-05-01

    :boom: Breaking Changes

    :nut_and_bolt: Other

    ... (truncated)

    Commits
    Maintainer changes

    This version was pushed to npm by juergba, a new releaser for mocha since your current version.


    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump decode-uri-component from 0.2.0 to 0.2.2

    Bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump codecov from 3.7.0 to 3.8.3

    Bump codecov from 3.7.0 to 3.8.3

    Bumps codecov from 3.7.0 to 3.8.3.

    Release notes

    Sourced from codecov's releases.

    v3.8.3

    Fixes

    • #329 fix: Test if response has two lines

    Dependencies

    • #306 Bump eslint-config-prettier from 7.2.0 to 8.3.0
    • #305 Bump eslint from 7.21.0 to 7.25.0
    • #302 Bump mock-fs from 4.13.0 to 4.14.0
    • #308 Bump lodash from 4.17.19 to 4.17.21
    • #309 Bump ignore-walk from 3.0.3 to 3.0.4
    • #310 Bump hosted-git-info from 2.8.8 to 2.8.9
    • #325 Bump prettier from 2.2.1 to 2.3.2
    • #326 Bump actions/setup-node from 2.1.5 to 2.2.0
    • #328 Bump lint-staged from 10.5.4 to 11.0.1
    • #330 Bump eslint from 7.25.0 to 7.31.0
    • #331 Bump ws from 7.3.1 to 7.5.3
    • #332 Bump urlgrey from 0.4.4 to 1.0.0
    • #334 Bump husky from 6.0.0 to 7.0.1
    • #333 Bump teeny-request from 7.0.1 to 7.1.1

    v3.8.2

    3.8.2

    Fixes

    • #304 Add coverage-final.json as a possible coverage file during file lookup

    v3.8.1

    Fixes

    • #246 Revert "Bump teeny-request from 6.0.1 to 7.0.0"

    v3.8.0

    Features

    • #160 Add Github Actions support

    Fixes

    • #173 Fix broken gcov command
    • #195 Update Node testing versions
    • #200 Remove flaky tests
    • #204 Create CHANGELOG and remove flaky v4 test
    • #208 Add license scan report and status
    • #220 Remove errant bitly

    Dependencies

    • #189 Bump lint-staged from 10.0.7 to 10.2.11
    • #190 [Security] Bump handlebars from 4.5.3 to 4.7.6
    • #191 Bump prettier from 1.19.1 to 2.0.5
    • #192 Bump mock-fs from 4.10.4 to 4.12.0
    • #196 Bump teeny-request from 6.0.1 to 7.0.0

    ... (truncated)

    Changelog

    Sourced from codecov's changelog.

    3.8.3

    Fixes

    • #329 fix: Test if response has two lines

    Dependencies

    • #306 Bump eslint-config-prettier from 7.2.0 to 8.3.0
    • #305 Bump eslint from 7.21.0 to 7.25.0
    • #302 Bump mock-fs from 4.13.0 to 4.14.0
    • #308 Bump lodash from 4.17.19 to 4.17.21
    • #309 Bump ignore-walk from 3.0.3 to 3.0.4
    • #310 Bump hosted-git-info from 2.8.8 to 2.8.9
    • #325 Bump prettier from 2.2.1 to 2.3.2
    • #326 Bump actions/setup-node from 2.1.5 to 2.2.0
    • #328 Bump lint-staged from 10.5.4 to 11.0.1
    • #330 Bump eslint from 7.25.0 to 7.31.0
    • #331 Bump ws from 7.3.1 to 7.5.3
    • #332 Bump urlgrey from 0.4.4 to 1.0.0
    • #334 Bump husky from 6.0.0 to 7.0.1
    • #333 Bump teeny-request from 7.0.1 to 7.1.1

    3.8.2

    Fixes

    • #304 Add coverage-final.json as a possible coverage file during file lookup

    3.8.1

    Fixes

    • #246 Revert "Bump teeny-request from 6.0.1 to 7.0.0"

    3.8.0

    Features

    • #160 Add Github Actions support

    Fixes

    • #173 Fix broken gcov command
    • #195 Update Node testing versions
    • #200 Remove flaky tests
    • #204 Create CHANGELOG and remove flaky v4 test
    • #208 Add license scan report and status
    • #220 Remove errant bitly

    Dependencies

    • #189 Bump lint-staged from 10.0.7 to 10.2.11
    • #190 [Security] Bump handlebars from 4.5.3 to 4.7.6
    • #191 Bump prettier from 1.19.1 to 2.0.5

    ... (truncated)

    Commits
    • e22061b Merge pull request #335 from codecov/3.8.3
    • 981df8b 3.8.3
    • 135555c Merge pull request #333 from codecov/dependabot/npm_and_yarn/teeny-request-7.1.1
    • 65b53a3 Merge pull request #334 from codecov/dependabot/npm_and_yarn/husky-7.0.1
    • 6e4af4d Bump teeny-request from 7.0.1 to 7.1.1
    • 1149168 Merge pull request #332 from codecov/dependabot/npm_and_yarn/urlgrey-1.0.0
    • 883785c Merge pull request #331 from codecov/dependabot/npm_and_yarn/ws-7.5.3
    • 04d5ff7 Merge pull request #330 from codecov/dependabot/npm_and_yarn/eslint-7.31.0
    • e6c5bf4 Bump husky from 6.0.0 to 7.0.1
    • f781bc4 Bump ws from 7.3.1 to 7.5.3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump node-fetch from 2.6.0 to 2.6.7

    Bump node-fetch from 2.6.0 to 2.6.7

    Bumps node-fetch from 2.6.0 to 2.6.7.

    Release notes

    Sourced from node-fetch's releases.

    v2.6.7

    Security patch release

    Recommended to upgrade, to not leak sensitive cookie and authentication header information to 3th party host while a redirect occurred

    What's Changed

    Full Changelog: https://github.com/node-fetch/node-fetch/compare/v2.6.6...v2.6.7

    v2.6.6

    What's Changed

    Full Changelog: https://github.com/node-fetch/node-fetch/compare/v2.6.5...v2.6.6

    v2.6.2

    fixed main path in package.json

    v2.6.1

    This is an important security release. It is strongly recommended to update as soon as possible.

    See CHANGELOG for details.

    Commits
    • 1ef4b56 backport of #1449 (#1453)
    • 8fe5c4e 2.x: Specify encoding as an optional peer dependency in package.json (#1310)
    • f56b0c6 fix(URL): prefer built in URL version when available and fallback to whatwg (...
    • b5417ae fix: import whatwg-url in a way compatible with ESM Node (#1303)
    • 18193c5 fix v2.6.3 that did not sending query params (#1301)
    • ace7536 fix: properly encode url with unicode characters (#1291)
    • 152214c Fix(package.json): Corrected main file path in package.json (#1274)
    • b5e2e41 update version number
    • 2358a6c Honor the size option after following a redirect and revert data uri support
    • 8c197f8 docs: Fix typos and grammatical errors in README.md (#686)
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by endless, a new releaser for node-fetch since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Add spread operator!

    Add spread operator!

    Usually "apply" is used as a spread operator, here's an example convert this

    Array.prototype.concat.apply([1,2,3],[3,4,5])
    

    into

    [1,2,3].concat(...[3,4,5])
    
    opened by Kreijstal 0
  • Bump ajv from 6.10.0 to 6.12.6

    Bump ajv from 6.10.0 to 6.12.6

    Bumps ajv from 6.10.0 to 6.12.6.

    Release notes

    Sourced from ajv's releases.

    v6.12.6

    Fix performance issue of "url" format.

    v6.12.5

    Fix uri scheme validation (@​ChALkeR). Fix boolean schemas with strictKeywords option (#1270)

    v6.12.4

    Fix: coercion of one-item arrays to scalar that should fail validation (failing example).

    v6.12.3

    Pass schema object to processCode function Option for strictNumbers (@​issacgerges, #1128) Fixed vulnerability related to untrusted schemas (CVE-2020-15366)

    v6.12.2

    Removed post-install script

    v6.12.1

    Docs and dependency updates

    v6.12.0

    Improved hostname validation (@​sambauers, #1143) Option keywords to add custom keywords (@​franciscomorais, #1137) Types fixes (@​boenrobot, @​MattiAstedrone) Docs:

    v6.11.0

    Time formats support two digit and colon-less variants of timezone offset (#1061 , @​cjpillsbury) Docs: RegExp related security considerations Tests: Disabled failing typescript test

    v6.10.2

    Fix: the unknown keywords were ignored with the option strictKeywords: true (instead of failing compilation) in some sub-schemas (e.g. anyOf), when the sub-schema didn't have known keywords.

    v6.10.1

    Fix types Fix addSchema (#1001) Update dependencies

    Commits
    • fe59143 6.12.6
    • d580d3e Merge pull request #1298 from ajv-validator/fix-url
    • fd36389 fix: regular expression for "url" format
    • 490e34c docs: link to v7-beta branch
    • 9cd93a1 docs: note about v7 in readme
    • 877d286 Merge pull request #1262 from b4h0-c4t/refactor-opt-object-type
    • f1c8e45 6.12.5
    • 764035e Merge branch 'ChALkeR-chalker/fix-comma'
    • 3798160 Merge branch 'chalker/fix-comma' of git://github.com/ChALkeR/ajv into ChALkeR...
    • a3c7eba Merge branch 'refactor-opt-object-type' of github.com:b4h0-c4t/ajv into refac...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v3.1.1)
  • v3.1.1(Feb 11, 2021)

  • v3.1.0(Jun 14, 2019)

    Updated dependencies and refactored in relation to the new dependency versions #295

    Eliminating some vulnerabilities in the process.

    Thanks to @uniibu

    Source code(tar.gz)
    Source code(zip)
  • v3.0.5(Apr 5, 2019)

  • v3.0.4(Mar 4, 2019)

  • v3.0.3(Sep 25, 2018)

  • v3.0.2(Sep 13, 2018)

    • Fix: arrow - Drop extra parentheses around IIFE #187
    • Fix: arrow-return - Proper parentheses for object literals #259
    • Fix: default-params - Properly handle destructuring and existing defaults #238
    • Fix: default-params - Support arrow functions Recast/#260
    • Upgrade all dependencies.
    • Throw better error message when invalid transform name passed through programming API
    • Add tests for the programming API
    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Sep 12, 2018)

  • v3.0.0(Sep 7, 2018)

    Breaking changes

    The arrow transform has been split to two separate transforms:

    • arrow - transforms normal functions to arrow functions (does nothing with return statements),
    • arrow-return - transforms return statements in arrow functions => { return x } to shorthand syntax => x.

    Thanks to @uniibu . See #269 for details.

    Additionally

    • Node < 6 no more officially supported.
    • Upgraded most internal dependencies.
    • Better handling of comments in arrow transform.
    Source code(tar.gz)
    Source code(zip)
  • v2.7.7(Sep 17, 2017)

  • v2.7.6(Sep 17, 2017)

  • v2.7.5(Aug 1, 2017)

  • v2.7.4(Jul 27, 2017)

  • v2.7.3(Jul 18, 2017)

    This release includes several pull requests from our wonderful contributors:

    • Transform nested concatenation #243 (fixing #242)
    • Make sure warnings cannot cause crash #233
    • Preserve 'async' anonymous function expressions #247

    Many thanks to all of you @josephfrazier, @andywer, @uniibu.

    Source code(tar.gz)
    Source code(zip)
  • v2.7.2(Mar 30, 2017)

    Bugfixes:

    • Fix missing "async" during class transform (Thanks to @lingsamuel)
    • Preserve comments in no-strict transform (Thanks to @josephfrazier)
    Source code(tar.gz)
    Source code(zip)
  • v2.7.1(Jan 22, 2017)

    Small fixes and improvements:

    • Fixed adding parenthesis around arrow functions when needed #105
    • Categorized commonjs transform as unsafe #215
    • Integrated code coverage to build process #212
    Source code(tar.gz)
    Source code(zip)
  • v2.7.0(Dec 14, 2016)

    New transform:

    • destruct-param detects cases where function takes object as parameter and replaces it with object destructuring pattern. It can be an overly aggressive transform, so for now it's limited to objects that have at most 4 properties. It's also not yet fully safe - there are some corner cases where it conflicts with the variables it creates by itself. So it also goes to unsafe category.
    Source code(tar.gz)
    Source code(zip)
  • v2.6.3(Dec 12, 2016)

  • v2.6.2(Dec 12, 2016)

  • v2.6.1(Oct 25, 2016)

  • v2.6.0(Oct 22, 2016)

  • v2.5.1(Oct 19, 2016)

  • v2.5.0(Oct 15, 2016)

  • v2.4.0(Sep 29, 2016)

    Adding a major feature of class inheritance detection.

    • Class inheritance support. Thanks to @apexearth
    • async functions support (through upgrade of Espree parser). Thanks to @tiansijie
    • STDIN support in Windows (also the unit tests now run in Windows).Thanks to @peet
    Source code(tar.gz)
    Source code(zip)
  • v2.3.3(Sep 6, 2016)

  • v2.3.2(Aug 26, 2016)

  • v2.3.1(Aug 25, 2016)

  • v2.3.0(Aug 23, 2016)

  • v2.2.0(Aug 19, 2016)

    New transform:

    • for to for-of #166

    Other notable changes:

    • Dropped Node < 4.0 support (this is really a breaking change, but given that Lebab itself is younger than Node 4.0 I wouldn't really expect anybody to rely on this).

    Additionally dropped Gulp from Lebab dev-dependencies.

    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Aug 14, 2016)

  • v2.1.0(Aug 11, 2016)

Owner
Lebab
Lebab turns your ES5 code into readable ES6.
Lebab
ES2015 [ES6] cheatsheet containing tips, tricks, best practices and code snippets

es6-cheatsheet A cheatsheet containing ES2015 [ES6] tips, tricks, best practices and code snippet examples for your day to day workflow. Contributions

David Leonard 13k Jan 2, 2023
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used

null 30.1k Jan 3, 2023
Airtable for TypeScript and JavaScript (ES7, ES6, ES5). Supports Airtable database. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeAirtable is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be

Think A.M. 11 Sep 11, 2022
⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

⚡️Blitz 12.5k Jan 4, 2023
Babel-plugin-amd-checker - Module format checking plugin for Babel usable in both Node.js the web browser environments.

babel-plugin-amd-checker A Babel plugin to check the format of your modules when compiling your code using Babel. This plugin allows you to abort the

Ferdinand Prantl 1 Jan 6, 2022
Babel plugin and helper functions for interoperation between Node.js native ESM and Babel ESM

babel-plugin-node-cjs-interop and node-cjs-interop: fix the default import interoperability issue in Node.js The problem to solve Consider the followi

Masaki Hara 15 Nov 6, 2022
easier than regex string matching patterns for urls and other strings. turn strings into data or data into strings.

url-pattern easier than regex string matching patterns for urls and other strings. turn strings into data or data into strings. This is a great little

null 562 Jan 5, 2023
the opposite of roff

Ronn Ronn builds manuals. It converts simple, human readable textfiles to roff for terminal display, and also to HTML for the web. The source format i

rtomayko 1.3k Dec 28, 2022
🦕 An opposite function of nullish coalescing operator

unnullish unnullish returns undefined if value is nullish, otherwise it executes callback and returns the result. It is an opposite function of the nu

Alisue 15 Dec 15, 2022
a Node.JS script to auto-import USB drives that are attached to a computer. Use it to turn your NAS into a smart photo / file importer.

File Vacuum 5000 ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ WARNING: This script is designed to manipulate files on both an external drive and another specif

null 46 Jan 10, 2022
A web tool for you to record your face and turn it into a 3D animation file.

Web Face Capture A free, open-source web tool for you to record your face and turn it into a 3D animation file. Go to the website Allow camera permisi

James Lee 9 Jan 6, 2023
✨ An IRL tokenization platform to turn your hopes, dreams, and desires into fundable NFTs on the Polygon blockchain using Chainlink, IPFS, Moralis, and NFT.Storage.

GoFundYourself Getting funding for your passion project, needs or dream doesn't have to be a nightmare! check out our live demo on Netlify Let's Fundi

Brian H. Hough | brianhuff.eth 7 Dec 6, 2022
Turn queries into easy-to-use tools your teammates can share.

Turn queries into easy-to-use tools your teammates can share. Parameterize! Visualize! Collaboratize?! qwaver links: Latest Build •Use Cases • Help! •

Brian Risk 8 Nov 3, 2022
In this project, I restructure my previous Awesome books app code. The goal is to practice ES6 syntax and also make the code more organized by using ES6 modules.

Awesome Books In this project, I will restructure my previous Awesome books app code. The goal is to make it more organized by using modules. I will a

Sidney Kaguli 9 Aug 23, 2022
Turns XLSX into a readable stream.

xlstream Memory-efficiently turns XLSX file into a transform stream with all its benefits. Stream is pausable. Emits all default events (data, end, et

Claviz 147 Dec 16, 2022
⛲ Sort import declarations into a pleasing and readable cascade.

⛲ eslint-plugin-cascading-imports This plugin allows to automatically enforce a visual "cascading" order for import declarations. Imports in each bloc

Florent 1 Jan 20, 2022
A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list✌️

A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list Examples available here: http://claude

Claudéric Demers 10.3k Jan 2, 2023
:globe_with_meridians: Turn any into an address autocomplete

Deprecation of service Places is going away on May 31st 2022. Read our blog post announcement. Introduction Algolia Places provides a fast, distribute

Algolia 5.4k Jan 9, 2023
Turn any dynamic website (especially wordpress) into a fast, secure, stable static site

Static site publisher Turn any dynamic website (especially wordpress) into a fast, secure, stable static site Reduced complexity - no need to run simp

Alex Ivkin 7 Apr 6, 2022