Socket
Socket
Sign inDemoInstall

jsx-transform

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-transform - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

13

lib/jsx.js

@@ -20,2 +20,3 @@ /*!

var fs = require('fs');
var getExtension = require('path').extname;
var jstransform = require('jstransform').transform;

@@ -123,2 +124,4 @@ var visitNode = require('./visitor');

* @param {Object=} options
* @param {String=} options.extensions Array of file extensions to run
* browserify transform on (default: `['.js', '.jsx', '.es', '.es6']`).
* @returns {Function} browserify transform

@@ -131,6 +134,14 @@ */

browserifyTransform.configure = function (options) {
if (typeof options.extensions === 'undefined') {
options.extensions = ['.js', '.jsx', '.es', '.es6'];
}
return function (filename) {
return through(function (buf, enc, next) {
try {
this.push(fromString(buf.toString('utf8'), options));
if (~options.extensions.indexOf(getExtension(filename))) {
this.push(fromString(buf.toString('utf8'), options));
} else {
this.push(buf.toString());
}
next();

@@ -137,0 +148,0 @@ } catch (err) {

3

package.json
{
"name": "jsx-transform",
"version": "2.0.0",
"version": "2.1.0",
"description": "JSX transpiler. Desugar JSX into JavaScript. A standard and configurable implementation of JSX decoupled from React.",

@@ -36,2 +36,3 @@ "files": [

"devDependencies": {
"browserify": "^10.0.0",
"expect.js": "^0.3.1",

@@ -38,0 +39,0 @@ "gulp": "^3.8.10",

@@ -83,6 +83,7 @@ # jsx-transform [![Build Status](http://img.shields.io/travis/alexmingoia/jsx-transform.svg?style=flat)](http://travis-ci.org/alexmingoia/jsx-transform) [![NPM version](http://img.shields.io/npm/v/jsx-transform.svg?style=flat)](https://npmjs.org/package/jsx-transform) [![Dependency Status](http://img.shields.io/david/alexmingoia/jsx-transform.svg?style=flat)](http://david-dm.org/alexmingoia/jsx-transform)

| Param | Type |
| --- | --- |
| [filename] | <code>String</code> |
| [options] | <code>Object</code> |
| Param | Type | Description |
| --- | --- | --- |
| [filename] | <code>String</code> | |
| [options] | <code>Object</code> | |
| [options.extensions] | <code>String</code> | Array of file extensions to run browserify transform on (default: `['.js', '.jsx', '.es', '.es6']`). |

@@ -89,0 +90,0 @@ **Example**

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