🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

jsx-i18n

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-i18n

Simple [jstransform](https://github.com/facebook/jstransform) pass for use with the JSX transformer in React 0.12+ to convert JSX `<$_>...</$_>` tags (only) to `$_(...)` calls, to simulate how React 0.11 behaved.

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
7
16.67%
Maintainers
2
Weekly downloads
 
Created
Source

jsx-i18n

Simple jstransform pass for use with the JSX transformer in React 0.12+ to convert JSX <$_>...</$_> tags (only) to $_(...) calls, to simulate how React 0.11 behaved.

Usage

You can write a simple script along the line of the following:

var visitors = require("react-tools/vendor/fbtransform/visitors");
var jstransform = require('jstransform');
var jsxI18n = require('jsx-i18n');


process.stdin.resume();
process.stdin.setEncoding("utf-8");

var js = "";
process.stdin.on("data", function(data) {
    js += data;
});

process.stdin.on("end", function() {
    var visitorList = jsxI18n.getVisitorList([
        "$_"
    ]).concat(visitors.getAllVisitors());
    js = jstransform.transform(visitorList, js).code;

    process.stdout.write(js);
});

This script reads JSX from stdin and writes JS to stdout. Example:

// in
var x = <div><$_ name={world}>hello %(name)s</$_></div>;

// out
var x = React.createElement("div", null, $_({name: world}, "hello %(name)s"));

FAQs

Package last updated on 05 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts