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

babel-jsxgettext

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-jsxgettext

A tool like jsxgettext, but works for es6 + jsx that babel support

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
129
decreased by-17.31%
Maintainers
1
Weekly downloads
 
Created
Source

babel-jsxgettext

NPM version build status Downloads js-standard-style

A tool like jsxgettext, but works for es6 + jsx that babel support.

I have a blog post explain my translation workflow in an Electron app with React + Babel.

Usage

$ npm install babel-jsxgettext --save-dev

API

var parser = require('babel-jsxgettext')

/**
 * The parser function
 * @param  {String}   input  The path to source JavaScript file
 * @param  {String}   output The path of the output PO file
 * @param  {String}   plugins Babel plugins, separate by `,`
 * @param  {Function} cb     The callback function
 */
parser(inputs, output, plugins, function (err) {
  if (err) throw err
  console.log('Job completed!')
})

Command line usage

Install globally with npm npm install babel-jsxgettext -g

  A tool like jsxgettext, but works for es6 + jsx that babel support

  Options
    --help                     Show this help
    --version                  Current version of package
    -p | --plugins             String - Babylon plugins list (`jsx` is always included)'
    -i | --input               String - The path to soure JavaScript file
    -o | --output              String - The path of the output PO file

  Usage
    $ babel-jsxgettext --help
    $ babel-jsxgettext <input> <output>

  Examples
    $ babel-jsxgettext ./test/*.js ./test.po
    $ babel-jsxgettext --plugins "classProperties,objectRestSpread" ./test/*.js test.po

Why

I'm Using Babel with React + JSX for most of my project, but there's no perfect and direct way to generate .po file from ES6 + JSX code(or from a directory).

acron-jsx support jsx but not all the feature I use in Babel(ES7 etc.,). So I grab the babylon parser from Babel and use it to generate .po file.

License

MIT

Keywords

FAQs

Package last updated on 12 Apr 2017

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