New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
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

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