Skip to content
/ commonize Public

A utility to convert RingoJS modules into pure CommonJS modules

Notifications You must be signed in to change notification settings

hns/commonize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Commonize

This is a RingoJS package that converts one or more RingoJS modules to portable CommonJS code by replacing their use of include() and export() with require() and the exports object, respectively. For example, the following fragment from the ringo/webapp/response module:

include('binary');
include('./util');
include('./mime');

export('Response',
       'skinResponse',
       'jsonResponse',
       'xmlResponse',
       'staticResponse',
       'redirectResponse',
       'notFoundResponse',
       'errorResponse');

will be converted to this:

var {ByteArray} = require('binary');
var {Headers, getMimeParameter} = require('./util');
var {mimeType} = require('./mime');

// Generated by commonize
exports.Response = Response;
exports.skinResponse = skinResponse;
exports.jsonResponse = jsonResponse;
exports.xmlResponse = xmlResponse;
exports.staticResponse = staticResponse;
exports.redirectResponse = redirectResponse;
exports.notFoundResponse = notFoundResponse;
exports.errorResponse = errorResponse;

Warning

This script will edit your files in-place without making backups.

Never ever run this script on resources that are not under a version control system.

Usage

bin/commonize path/to/directory/or/file

About

A utility to convert RingoJS modules into pure CommonJS modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published