Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-es2015-modules-nej

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-modules-nej

transform es6 module to nej module

  • 1.1.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

将es6的模块语法转换为nej的模块语法

import

1. 注入参数

在es6中,引入的对象为只读对象,因此使用时必须将对象复制出来使用。这个版本暂时删掉了,因为感觉没啥用。

import {o, f, r} from 'nej';
let obj = o, func = f, arr = r;

2. 输出结果集空间

不需要额外引入,直接写export即可

3. 资源后缀

  • 对于javascript资源,是否需要文件扩展名,保持和nej语法一致
  • 对于css,html,json资源,无需添加前缀标识
  • 不支持regular!前缀标识

export

ES6的export语法中,支持其中常用的两种写法,需要支持其它写法,欢迎反馈

export { name1, name2, …, nameN }; //支持
export { variable1 as name1, variable2 as name2, …, nameN };
export let name1, name2, …, nameN;
export let name1 = …, name2 = …, …, nameN;

export default expression; //支持
export default function () { … }
export default function name1() { … }
export { name1 as default, … };

export * from …;
export { name1, name2, …, nameN } from …;
export { import1 as name1, import2 as name2, …, nameN } from …;

FAQs

Package last updated on 10 Oct 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc