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

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 0.13.0 to 0.14.0

32

lib/jsx.js

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

var trimTrailingSpaces = require('./trimTrailingSpaces');
var through = require('through2');

@@ -92,3 +93,34 @@ /**

/**
* Return a browserify transform.
*
* See @link module:jsx-transform.transform for options.
*
* @example
*
* ```javascript
* var browserify = require('browserify');
* var jsx = require('jsx-transform').browserify;
*
* browserify()
* .transform(jsx(options))
* .bundle()
* ```
*
* @param {Object} options
* @returns {Stream} browserify transform
*/
function browserify(options) {
return through(function (buf, enc, next) {
try {
this.push(transform(buf.toString('utf8'), options));
next();
} catch (err) {
next(err);
}
});
}
module.exports = {
browserify: browserify,
transform: transform,

@@ -95,0 +127,0 @@ transformFile: transformFile,

5

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

@@ -32,3 +32,4 @@ "files": [

"dependencies": {
"jstransform": "^10.1.0"
"jstransform": "^10.1.0",
"through2": "^0.6.5"
},

@@ -35,0 +36,0 @@ "devDependencies": {

@@ -121,2 +121,3 @@ # 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)

* [jsx-transform~transformFile(path, options)](#module_jsx-transform..transformFile)
* [jsx-transform~browserify(options)](#module_jsx-transform..browserify)

@@ -157,2 +158,5 @@ <a name="module_jsx-transform..transform"></a>

- jsx `String` - Constructor name (default: set by docblock).
- passArray `String` - if false follows default react-tools/babel jsx behavour
`DOM('h1', null, "hello", firstName + " " + lastName)` instead of
`DOM('h1', null, ["Hello ", firstName + " " + lastName])`.

@@ -172,4 +176,26 @@ **Scope**: inner function of [jsx-transform](#module_jsx-transform)

**Returns**: `String`
<a name="module_jsx-transform..browserify"></a>
##jsx-transform~browserify(options)
Return a browserify transform.
See @link module:jsx-transform.transform for options.
**Params**
- options `Object`
**Scope**: inner function of [jsx-transform](#module_jsx-transform)
**Returns**: `Stream` - browserify transform
**Example**
```javascript
var browserify = require('browserify');
var jsx = require('jsx-transform').browserify;
browserify()
.transform(jsx(options))
.bundle()
```
## BSD Licensed

@@ -176,0 +202,0 @@

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