Socket
Book a DemoInstallSign in
Socket

babel-preset-mjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-mjs

Babel preset to transpile JS to restricted mjs JS.

0.0.4
latest
Source
npmnpm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-preset-mjs

Babel preset to transpile JS to restricted mjs JS.

Features

RestrictionSolution
No String, Number, RegExp, Date, Function, etc.Not solved
No try/catch/finally.Transpiled to functions that make try/catch/finally work.
No error classes.Not solved
No new or prototypes. In order to create an object with a custom prototype, use Object.create(), which is available.new is handled by Object.create(), and the constructor is called on the resultant object
Strict mode only. No for..of, =>, destructors, generators, proxies, promises, classes, template strings.Handled by babel-preset-es2015 (included by default).
No var, only let.All uses of var are changed to let.
No getters, setters, valueOf.Not solved
No == or !=, only === and !==.All uses of == are transpiled to a manually evaluated loose equals.
load() is used to load external JS, not very standardized and pollutes the global scope.Not solved
No setTimeout() and setInterval() API.Polyfilled using api_timer.js.

Usage

.babelrc:

{
  "presets": [
    "mjs"
  ]
}

License

Licensed under MIT license.

Copyright (C) 2017 Karim Alibhai.

Keywords

babel

FAQs

Package last updated on 14 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.