cjsx-register
Advanced tools
Comparing version 1.0.1 to 1.0.2
16
index.js
@@ -1,4 +0,12 @@ | ||
// Adds the transpile option to coffeescript. Important for JSX support. | ||
require('module').prototype.options = {transpile: {presets: ['env']}}; | ||
require('coffeescript/register'); | ||
require('babel-register') | ||
fs = require('fs') | ||
coffee = require('coffeescript'); | ||
require.extensions['.cjsx'] = function(module, filename) { | ||
var src = fs.readFileSync(filename, {encoding: 'utf8'}); | ||
try { | ||
src = coffee.compile(src, {transpile: {presets: ['react']}}); | ||
} catch (e) { | ||
throw new Error('Error transforming ' + filename + ' from CJSX: ' + e.toString()); | ||
} | ||
module._compile(src, filename); | ||
}; |
{ | ||
"name": "cjsx-register", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Allow requiring .cjsx as .coffee", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
921
11
0