Comparing version 3.0.1 to 3.1.0
14
bin.js
#!/usr/bin/env node | ||
const path = require('path'); | ||
const ascjs = require('./index.js'); | ||
const $ascjs = require('./index.js'); | ||
const ascjs = input => { | ||
const output = $ascjs(input); | ||
return noDefault ? | ||
output.replace(`${$ascjs.EXPORT}.default`, 'module.exports') : | ||
output; | ||
}; | ||
@@ -10,5 +16,8 @@ const argv = process.argv.slice(2); | ||
let noDefault = false; | ||
const ignore = []; | ||
options.forEach(arg => { | ||
if (/^--ignore=/.test(arg)) | ||
if (/^--no-default$/.test(arg)) | ||
noDefault = true; | ||
else if (/^--ignore=/.test(arg)) | ||
ignore.push.apply( | ||
@@ -33,2 +42,3 @@ ignore, | ||
ascjs --ignore=a.js,b.js sourceFile | ||
ascjs --no-default | ||
ascjs sourceFile destFile | ||
@@ -35,0 +45,0 @@ ascjs sourceFolder destFolder # dest is required |
{ | ||
"name": "ascjs", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "ES2015 to CommonJS import/export transformer", | ||
@@ -33,5 +33,5 @@ "bin": "bin.js", | ||
"devDependencies": { | ||
"coveralls": "^3.0.0", | ||
"coveralls": "^3.0.7", | ||
"istanbul": "^0.4.5" | ||
} | ||
} |
@@ -36,2 +36,3 @@ # ascjs | ||
ascjs --ignore=a.js,b.js sourceFile | ||
ascjs --no-default | ||
ascjs sourceFile | ||
@@ -74,2 +75,7 @@ ascjs sourceFile destFile | ||
### Flags | ||
* `--ignore=...` a comma separated paths to ignore parsing | ||
* `--no-default` remove the `__esModule` flag and export default via `module.exports = ` | ||
### Example | ||
@@ -76,0 +82,0 @@ This module can transform the following ES2015+ code |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14542
297
109