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

cjsx-register

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjsx-register - npm Package Compare versions

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",

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