🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

jtaro-module

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jtaro-module - npm Package Compare versions

Comparing version
0.2.3
to
0.2.4
+1
-1
package.json
{
"name": "jtaro-module",
"version": "0.2.3",
"version": "0.2.4",
"description": "Explain the ES6 module to Es5 syntax",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -30,3 +30,3 @@ # JTaro Module

1. 安装`npm install -D jtaro-module`
2. 在自己的项目目录里使用命名行(终端)运行`node node_modules/jtaro-module/src/server.js`,开启本地静态文件服务,默认为3000端口,可自定义端口`node node_modules/jtaro-module/src/server.js 3030`
2. 在自己的项目目录里使用命令行(终端)运行`node node_modules/jtaro-module/src/server.js`,开启本地静态文件服务,默认为3000端口,可自定义端口`node node_modules/jtaro-module/src/server.js 3030`
3. 在index.html的head引入`node_modules/jtaro-module/src/client.js`,在body最后引入入口文件(只要是js文件都可当作入口文件),JTaro Module将会从入口文件开始加载所有依赖文件

@@ -270,3 +270,3 @@ 4. 在浏览器上运行`localhost:3000/index.html`,所有js文件都会被拦截,所有符合条件的import/export将会被转换

}, babel({
include: '**/a.js',
include: '**/a.js', //该路径相对于entry(入口文件)
'presets': [

@@ -273,0 +273,0 @@ [

@@ -1,2 +0,2 @@

/*! JTaro-Module server.js v0.2.1 ~ (c) 2017 Author:BarZu Git:https://github.com/chjtx/JTaro-Module/ */
/*! JTaro-Module server.js v0.2.4 ~ (c) 2017 Author:BarZu Git:https://github.com/chjtx/JTaro-Module/ */
var fs = require('fs')

@@ -9,2 +9,3 @@ var path = require('path')

var configPath = './jtaro.module.config' // 默认配置文件
var showConfigError = false

@@ -19,3 +20,9 @@ // 截取命令

if (/^--config=/.test(process.argv[i])) {
showConfigError = true
configPath = process.argv[i].replace('--config=', '').replace(/^("|')|("|')$/g, '').trim()
// 如果不是以../或./开头的文件,自动加上./
if (!/^(\.\/|\.\.\/)/.test(configPath)) {
configPath = './' + configPath
}
}

@@ -29,2 +36,5 @@ }

} catch (e) {
if (showConfigError) {
throw e
}
config = {}

@@ -31,0 +41,0 @@ }