babel-convert-jsy-from-js

0.0.4 • Public • Published

babel-convert-jsy-from-js

Convert JavaScript, Babel or Babylon AST into offside indented JSY formatted source code.

Use

$ npm install --save-dev babel-convert-jsy-from-js
$ cat node_about_example.js
node_about_example.js
const http = require('http');
 
const hostname = '127.0.0.1';
const port = 3000;
 
const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});
 
server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
Convert to JSY from JS
$ npx jsy-from-js node_about_example.js
jsy output:
const http = require('http')
 
const hostname = '127.0.0.1'
const port = 3000
 
const server = http.createServer @
  (req, res) => ::
    res.statusCode = 200
    res.setHeader('Content-Type', 'text/plain')
    res.end('Hello World\n')
 
 
server.listen @
  port
  hostname
  () => ::
    console.log(`Server running at http://${hostname}:${port}/`)

/babel-convert-jsy-from-js/

    Package Sidebar

    Install

    npm i babel-convert-jsy-from-js

    Weekly Downloads

    1

    Version

    0.0.4

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • shanewholloway