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

one

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

one - npm Package Compare versions

Comparing version 1.7.6 to 1.7.7

4

lib/render.js

@@ -79,3 +79,3 @@ var readFile = require('fs').readFile,

sortedPkgs = pkgs.sort(function(a, b){
return a.name[0] > b.name[0];
return a.name.localeCompare(b.name);
});

@@ -114,3 +114,3 @@

sortedModules = modules.sort(function(a, b){
return a.filename[0] > b.filename[0];
return a.filename.localeCompare(b.filename);
});

@@ -117,0 +117,0 @@

{
"name":"one",
"version":"1.7.6",
"version":"1.7.7",
"description":"Transform NodeJS packages into single stand-alone script files.",

@@ -5,0 +5,0 @@ "author":"Azer Koculu <azer@kodfabrik.com>",

OneJS is a command-line utility for converting CommonJS packages to single, stand-alone JavaScript
files that can be run on web browsers.
# Motivation
# MOTIVATION
* **Reusability** OneJS lets developers code JavaScript for one platform and run everywhere, without requiring any additional effort.

@@ -20,3 +21,3 @@ * **Elegant Modularization** Modules and packages specs of CommonJS are what web apps exactly needs: a very well designed way to structure JavaScript code.

# Install
# INSTALL
```bash

@@ -26,6 +27,8 @@ $ npm install one

# First Steps
# MANUAL
## Creating the Bundle Script
## First Steps
### Creating the Bundle Script
OneJS walks the modules and dependencies defined by package.json files. To create your bundle, just go a project directory and type `onejs build` command:

@@ -37,3 +40,3 @@

## Experimenting the Bundle Script
### Experimenting the Bundle Script

@@ -54,3 +57,3 @@ The output OneJS generates can be used by NodeJS, too. It's the easiest way of making sure if the output works or not.

## Using the NodeJS Core Library
### Using the NodeJS Core Library

@@ -199,1 +202,9 @@ Many modules of the core NodeJS library is able to be used by web projects, as well. OneJS has an 'install' command that converts demanded remote NodeJS module to a package on the fly:

* See the content of `projectName.map` object if it contains the missing dependency
# TESTING
Run `npm test` for running all test modules. And run `make test module=?` for specific test modules;
```bash
> make test module=build
```

@@ -390,22 +390,2 @@ var exampleProject = (function(global, undefined){

});
exampleProject.pkg(3, function(parents){
return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer, console, process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, 1, function(parents){

@@ -464,2 +444,22 @@ return {

return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer, console, process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, function(parents){
return {
'id':7,

@@ -466,0 +466,0 @@ 'name':'vegetables',

@@ -297,22 +297,2 @@ var exampleProject = (function(global, undefined){

});
exampleProject.pkg(3, function(parents){
return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, 1, function(parents){

@@ -371,2 +351,22 @@ return {

return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, function(parents){
return {
'id':7,

@@ -373,0 +373,0 @@ 'name':'vegetables',

@@ -93,3 +93,3 @@ var exampleProject = (function(global, undefined){

exports.argv = ['onejs'];
exports.env = {"npm_config_save_dev":"","npm_config_browser":"google-chrome","npm_config_viewer":"man","npm_config_showlevel":"2","DIR_webkitcss":"/home/azer/dev/webkit-css","npm_config_rollback":"true","DIR_express":"/home/azer/dev/express","DIR_media":"/media","DIR_lite":"/home/azer/dev/firebug1.4/content/lite","XDG_DATA_HOME":"/home/azer/.local/share","npm_config_usage":"","DIR_bk":"/home/azer/bookmarks","DIR_delopt":"/home/azer/.opt/delicious-surf","DIR_algorithms":"/media/a/movie/mit/algorithms","DIR_emacsfiles":"/home/azer/.config/emacsfiles","SHELL":"/bin/bash","TERM":"xterm-256color","npm_config_globalignorefile":"/usr/etc/npmignore","DIR_jssnippets":"/home/azer/.local/share/snippets/js2-mode","DIR_onebox":"/home/azer/dev/onejs-sandboxes","npm_config_init_author_url":"","npm_config_shell":"/bin/bash","npm_config_parseable":"","DIR_mac":"/home/azer/dev/mac","DIR_music":"/media/a/music","npm_config_email":"azer@kodfabrik.com","DIR_wallpaper":"/home/azer/.config/wallpaper","DIR_firebug":"/home/azer/dev/firebug1.4/content/firebug","npm_config_userignorefile":"/home/azer/.npmignore","WINDOWID":"25165830","HUSHLOGIN":"FALSE","npm_config_cache_max":"null","npm_config_init_author_email":"","DIR_xmonad":"/home/azer/.xmonad","npm_config_ignore":"","npm_config_long":"","npm_config_npat":"","npm_config_registry":"https://registry.npmjs.org/","ANT_HOME":"/usr/share/apache-ant","DIR_h":"/home/azer","npm_config_message":"%s","npm_config_versions":"","DIR_visually":"/home/azer/dev/visually","USER":"azer","npm_package_description":"Transform NodeJS packages into single stand-alone script files.","DIR_dotfiles":"/home/azer/.config/dotfiles","DIR_delicioussurf":"/home/azer/dev/delicious-surf","npm_config_logprefix":"true","npm_config_globalconfig":"/usr/etc/npmrc","DIR_stonetunnel":"/home/azer/dev/stonetunnel","DIR_docs":"/media/a/docs","DIR_dev":"/home/azer/dev","npm_config_always_auth":"","DIR_boxcars":"/home/azer/dev/boxcars","DIR_vms":"/home/azer/VirtualBox VMs","DIR_highkick":"/home/azer/dev/highkick","NEO4J_HOME":"/home/azer/opt/neo4j","DIR_zen":"/home/azer/dev/zen","DIR_emacsprofiles":"/home/azer/.config/emacsfiles/profiles","DIR_api":"/home/azer/dev/api.multiplayerchess.com","CLOJURE_EXT":"/home/azer/.clojure","DIR_emacs":"/home/azer/.config/emacsfiles","DIR_surfdev":"/home/azer/dev/surf","DIR_a":"/media/a","DIR_b":"/media/b","MOZ_PLUGIN_PATH":"/usr/lib/mozilla/plugins","MAVEN_OPTS":"-Xmx512m","npm_package_author_name":"Azer Koculu","DIR_chatcore":"/home/azer/dev/zen/zendesk_chat_core","DIR_c":"/media/c","DIR_console":"/home/azer/dev/mac/zendesk_console","DIR_tmp":"/home/azer/tmp","XDG_CONFIG_DIRS":"/etc/xdg:/etc/xdg","npm_package_dependencies_highkick":"1.x","DIR_surf":"/home/azer/.surf","npm_package_dependencies_functools":"1.x","npm_config_proprietary_attribs":"true","MAIL":"/var/spool/mail/azer","PATH":"/usr/lib/node_modules/npm/bin/node-gyp-bin:/home/azer/dev/onejs/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/azer/.node_modules/.bin:/home/azer/opt/leiningen:/home/azer/opt/neo4j/bin:/var/lib/gems/1.8/bin/:/home/azer/opt/clojure-contrib/launchers/bash:/home/azer/opt/leiningen:/home/azer/opt/android/tools:/home/azer/opt/android/platform-tools:/home/azer/.local/bin","npm_config_argv":"{'remain':[],'cooked':['test'],'original':['test']}","npm_config_coverage":"","npm_config_json":"","npm_config_logfd":"2","DIR_snippets":"/home/azer/.local/share/snippets","npm_package_dependencies_optimist":"0.x","npm_config_pre":"","HG":"/usr/bin/hg","_":"./bin/onejs","npm_config_description":"true","npm_config_https_proxy":"","npm_config_userconfig":"/home/azer/.npmrc","PWD":"/home/azer/dev/onejs","npm_config_npaturl":"http://npat.npmjs.org/","DIR_chessbench":"/home/azer/dev/chess-benchmark","JAVA_HOME":"/opt/java","npm_package_dependencies_log4js":"0.4.1","npm_config_bindist":"0.6-ares1.7.5-DEV-evundefined-openssl1.0.1c-v83.6.6.25-linux-x64-3.3.7-1-ARCH","npm_config_node_version":"0.6.18","npm_config_user":"","npm_package_dependencies_mustache":"0.x","npm_lifecycle_event":"test","DIR_one":"/home/azer/dev/onejs","LANG":"en_US.UTF-8","npm_package_name":"one","npm_package_keywords_0":"build","npm_config_editor":"vi","npm_config_save":"","DIR_luke":"/home/azer/.config/wallpaper/images/luke","npm_package_keywords_1":"commonjs","npm_config_tag":"latest","DIR_mit":"/media/a/movie/mit","TZ":"US/Pacific","npm_package_keywords_2":"browser","npm_config_global":"","npm_config_username":"azer","DIR_resumes":"/home/azer/resumes","npm_package_bin_onejs":"./bin/onejs","npm_config_force":"","DIR_www":"/home/azer/www","npm_package_dependencies_genpkg":"0.x","npm_package_engines_node":"*","npm_config_searchopts":"","DIR_chat":"/home/azer/dev/zen/zendesk_chat","PS3":"> ","npm_package_main":"./lib","npm_config_depth":"null","DIR_functools":"/home/azer/dev/functools","DIR_opt":"/home/azer/.opt","DIR_bin":"/home/azer/.local/bin","npm_package_version":"1.7.5","npm_config_outfd":"1","npm_config_rebuild_bundle":"true","npm_config_searchsort":"name","DIR_lowkick":"/home/azer/dev/lowkick","npm_config_unicode":"true","npm_config_yes":"","DIR_core":"/home/azer/dev/zen/zendesk_chat_core","COLORFGBG":"default;default","SHLVL":"6","PS4":"+ ","HOME":"/home/azer","DIR_drone":"/home/azer/dev/mac/drone","TERMINFO":"/usr/share/terminfo","XDG_CONFIG_HOME":"/home/azer/.config","npm_package_scripts_test":"./node_modules/highkick/bin/highkick test/main.js","npm_config_ca":"'-----BEGIN CERTIFICATE-----\\nMIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC\\nVVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x\\nIjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w\\nbUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y\\nMTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV\\nBAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj\\nYXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA\\naXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE\\nOgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz\\nGn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl\\ny0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC\\nl7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv\\nyNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl\\nZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op\\n-----END CERTIFICATE-----'","npm_config_loglevel":"http","npm_config_strict_ssl":"true","DIR_delshare":"/home/azer/.local/share/delicious-surf","npm_config_dev":"","npm_config_group":"100","DIR_share":"/home/azer/.local/share","npm_config_version":"","DIR_hive":"/home/azer/dev/mac/hive","XDG_CACHE_HOME":"/home/azer/.cache","npm_config_cache_min":"","DIR_combiner":"/home/azer/dev/combiner","LOGNAME":"azer","npm_config_cache":"/home/azer/.npm","npm_config_searchexclude":"","DIR_neo4j":"/home/azer/opt/neo4j","npm_config_color":"true","npm_lifecycle_script":"./node_modules/highkick/bin/highkick test/main.js","XDG_DATA_DIRS":"/usr/local/share/:/usr/share/:/usr/local/share/:/usr/share/","J2SDKDIR":"/usr/lib/jvm/java-6-openjdk","npm_package_author_email":"azer@kodfabrik.com","npm_config_proxy":"","npm_config_save_optional":"","BROWSER":"delicious-surf","npm_config_user_agent":"npm/1.1.21 node/v0.6.18","DIR_zenchat":"/home/azer/dev/zen/zenchat","WINDOWPATH":"7","DIR_disko":"/media/disko","DISPLAY":":0","npm_package_dependencies_combiner":"1.2.x","npm_config_bin_publish":"","npm_config_production":"","DIR_bookmarks":"/home/azer/bookmarks","J2REDIR":"/usr/lib/jvm/java-6-openjdk/jre","npm_config_init_version":"0.0.0","npm_config_umask":"022","DIR_rap":"/media/a/music/rap","npm_package_dependencies_boxcars":"0.x","npm_config_git":"git","npm_config_init_author_name":"","DIR_jedi":"/media/a/music/rap/jedi","G_BROKEN_FILENAMES":"1","npm_package_directories_lib":"./lib","npm_config_onload_script":"","npm_config_tmp":"/tmp","npm_config_unsafe_perm":"true","COLORTERM":"rxvt-xpm","XAUTHORITY":"/home/azer/.Xauthority","npm_config_link":"","npm_config_prefix":"/usr"};
exports.env = {"npm_config_save_dev":"","npm_config_browser":"google-chrome","npm_config_viewer":"man","DIR_webkitcss":"/home/azer/dev/webkit-css","npm_config_rollback":"true","DIR_express":"/home/azer/dev/express","DIR_media":"/media","DIR_lite":"/home/azer/dev/firebug1.4/content/lite","XDG_DATA_HOME":"/home/azer/.local/share","npm_config_usage":"","DIR_bk":"/home/azer/bookmarks","DIR_delopt":"/home/azer/.opt/delicious-surf","DIR_algorithms":"/media/a/movie/mit/algorithms","DIR_emacsfiles":"/home/azer/.config/emacsfiles","TERM":"xterm-256color","SHELL":"/bin/bash","npm_config_globalignorefile":"/usr/etc/npmignore","DIR_jssnippets":"/home/azer/.local/share/snippets/js2-mode","DIR_onebox":"/home/azer/dev/onejs-sandboxes","npm_config_init_author_url":"","npm_config_shell":"/bin/bash","npm_config_parseable":"","DIR_mac":"/home/azer/dev/mac","DIR_music":"/media/a/music","npm_config_email":"azer@kodfabrik.com","DIR_wallpaper":"/home/azer/.config/wallpaper","DIR_firebug":"/home/azer/dev/firebug1.4/content/firebug","npm_config_userignorefile":"/home/azer/.npmignore","WINDOWID":"33554438","npm_config_cache_max":"null","npm_config_init_author_email":"","npm_config_sign_git_tag":"","DIR_xmonad":"/home/azer/.xmonad","npm_config_ignore":"","npm_config_long":"","npm_config_fetch_retries":"2","npm_config_npat":"","npm_config_registry":"https://registry.npmjs.org/","ANT_HOME":"/usr/share/apache-ant","DIR_h":"/home/azer","npm_config_message":"%s","npm_config_versions":"","DIR_visually":"/home/azer/dev/visually","USER":"azer","npm_package_description":"Transform NodeJS packages into single stand-alone script files.","DIR_dotfiles":"/home/azer/.config/dotfiles","DIR_delicioussurf":"/home/azer/dev/delicious-surf","npm_config_globalconfig":"/usr/etc/npmrc","DIR_stonetunnel":"/home/azer/dev/stonetunnel","DIR_docs":"/media/a/docs","DIR_dev":"/home/azer/dev","npm_config_always_auth":"","DIR_boxcars":"/home/azer/dev/boxcars","DIR_vms":"/home/azer/VirtualBox VMs","DIR_highkick":"/home/azer/dev/highkick","NEO4J_HOME":"/home/azer/opt/neo4j","DIR_mapy":"/home/azer/dev/map","DIR_zen":"/home/azer/dev/zen","DIR_emacsprofiles":"/home/azer/.config/emacsfiles/profiles","DIR_api":"/home/azer/dev/api.multiplayerchess.com","CLOJURE_EXT":"/home/azer/.clojure","npm_config_cache_lock_retries":"10","DIR_emacs":"/home/azer/.config/emacsfiles","DIR_surfdev":"/home/azer/dev/surf","DIR_a":"/media/a","DIR_map":"/home/azer/dev/map","DIR_b":"/media/b","MOZ_PLUGIN_PATH":"/usr/lib/mozilla/plugins","MAVEN_OPTS":"-Xmx512m","npm_package_author_name":"Azer Koculu","DIR_chatcore":"/home/azer/dev/zen/zendesk_chat_core","DIR_c":"/media/c","DIR_console":"/home/azer/dev/mac/zendesk_console","DIR_tmp":"/home/azer/tmp","XDG_CONFIG_DIRS":"/etc/xdg:/etc/xdg","DIR_surf":"/home/azer/.surf","npm_package_dependencies_functools":"1.x","npm_config_fetch_retry_mintimeout":"10000","npm_config_proprietary_attribs":"true","MAIL":"/var/spool/mail/azer","PATH":"/usr/lib/node_modules/npm/bin/node-gyp-bin:/home/azer/dev/onejs/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/azer/.node_modules/.bin:/home/azer/opt/leiningen:/home/azer/opt/neo4j/bin:/var/lib/gems/1.8/bin/:/home/azer/opt/clojure-contrib/launchers/bash:/home/azer/opt/leiningen:/home/azer/opt/android/tools:/home/azer/opt/android/platform-tools:/home/azer/.local/bin","npm_config_argv":"{'remain':[],'cooked':['test'],'original':['test']}","npm_config_coverage":"","npm_config_json":"","DIR_snippets":"/home/azer/.local/share/snippets","npm_package_dependencies_optimist":"0.x","npm_config_pre":"","DIR_myresume":"/home/azer/resumes/azer","HG":"/usr/bin/hg","_":"./bin/onejs","npm_package_readme":"'OneJS is a command-line utility for converting CommonJS packages to single, stand-alone JavaScript\\nfiles that can be run on web browsers.\\n\\n# MOTIVATION\\n\\n* **Reusability** OneJS lets developers code JavaScript for one platform and run everywhere, without requiring any additional effort.\\n* **Elegant Modularization** Modules and packages specs of CommonJS are what web apps exactly needs: a very well designed way to structure JavaScript code.\\n* **NPM** OneJS moves the revolution of NPM one step forward and makes it available for client-side projects!\\n* **No Spaghetti Code** No awkward headers, no framework-specific definitions.\\n* **Reliable code generation** OneJS doesn't change your source code. It generates a container that emulates a simple NodeJS environment.\\n* **Unobtrusive Code** OneJS puts all the content into an isolated JS object.\\n\\n![](http://oi41.tinypic.com/aw2us3.jpg)\\n\\n### Examples\\n* See the example project included in this repository\\n* MultiplayerChess.com ([Source Code](https://github.com/azer/multiplayerchess.com/tree/master/frontend) - [Output](http://multiplayerchess.com/mpc.js) )\\n* [ExpressJS built by OneJS](https://gist.github.com/2415048)\\n* [OneJS built by OneJS](https://gist.github.com/2998719)\\n\\n# INSTALL\\n```bash\\n$ npm install one\\n```\\n\\n# MANUAL\\n\\n## First Steps\\n\\n### Creating the Bundle Script\\n\\nOneJS walks the modules and dependencies defined by package.json files. To create your bundle, just go a project directory and type `onejs build` command:\\n\\n```\\n$ onejs build package.json bundle.js\\n```\\n\\n### Experimenting the Bundle Script\\n\\nThe output OneJS generates can be used by NodeJS, too. It's the easiest way of making sure if the output works or not.\\n\\n```\\n> var exampleProject = require('./bundle');\\n> exampleProject.main() // calls main module, returns its exports\\n> exampleProject.require('./b') // each package object has a require method available for external calls\\n```\\n\\nIn the case what you need is to try it in web browsers, onejs has a \\'server\\' option that'll publish the source code at `localhost:1338` let you debug the output with Firebug Lite easily;\\n\\n```\\n$ ../bin/onejs server example-project/package.json\\n```\\n\\n### Using the NodeJS Core Library\\n\\nMany modules of the core NodeJS library is able to be used by web projects, as well. OneJS has an 'install' command that converts demanded remote NodeJS module to a package on the fly:\\n\\n```javascript\\n> onejs install assert path url\\n```\\n\\nThe reference of available modules that you can install: https://github.com/azer/onejs/blob/master/lib/install_dict.js\\n\\n## Process\\n\\nOneJS includes a simple emulation of [NodeJS' process](http://nodejs.org/api/process.html). (Pass --noprocess if you don't need it)\\n\\n```javascript\\n> exampleProject.require('dependency'), exampleProject.require('./b');\\n> exampleProject.lib.process.stdout.write(\\'Hello World\\');\\n> exampleProject.stdout();\\n\\'Hello World\\'\\n```\\n\\n## Debug Mode\\n\\nPass `--debug` parameter disabling cache and passing ENV variables to the built file. If we assume that we have a module that depends on ENV;\\n\\n```javascript\\nif( process.env.VERBOSE ){\\n console.log( \\'fabula de narratur\\' );\\n}\\n```\\nAbove module becomes available to access ENV on debug-mode;\\n\\n```bash\\n$ VERBOSE=1 onejs build package.json --debug\\n```\\n\\n## Requiring Global Variables\\n\\nOneJS doesn't change the way we access global variables. However, we may want to use require statements to access global variables (such as document, jQuery etc..) for purposes like dependency injection or documentation. Following example demonstrates the usage of `--tie` option that lets us require global variables;\\n\\n```javascript\\nvar $ = require('jquery'),\\n dom = require('dom'),\\n pi = require('pi');\\n\\n$(dom).ready(function(){\\n console.log( pi == Math.PI ); // true\\n});\\n```\\n\\n```bash\\n$ onejs build package.json --tie pi=Math.PI,jquery=jQuery,dom=document\\n```\\n\\n## Excluding Specific Dependencies\\n\\nThere are some cases we prefer to not have some dependency packages in the build. The `--exclude` option leads OneJS ignore the specified packages;\\n\\n```bash\\n$ onejs build package.json --exclude underscore,request\\n```\\n\\nIf the case is to remove a duplication from the build, it would be a good idea to combine `--tie` and `--exclude` together;\\n\\n```bash\\n$ onejs build package.json --exclude underscore --tie underscore=window._\\n```\\n\\n## Sandboxing Console Object\\n\\nOneJS provides an embed, encapsulated console object (disabled by default). Pass `--sandbox-console` if needed, output is available by `projectName.stdout()` and `project.stderr()`.\\n\\n```bash\\n$ onejs build package.json foobar.js --sandbox-console\\n```\\n\\n```javascript\\n> var foobar = require('./foobar');\\n> foobar.stdout();\\n'Trying out the embed console'\\n'Hello world!'\\n> foobar.stderr()\\n'warning! something may be going wrong!'\\n'error! something went wrong!'\\n```\\n\\n## NodeJS API\\n\\nYou can also use OneJS from inside your own NodeJS code.\\n\\n```javascript\\nvar one = require('one');\\n\\nvar manifest = 'path/to/manifest.json',\\n target = 'path/to/bundle.js',\\n options = {\\n debug: true // see available options section below\\n }; \\n\\none.build(manifest, options, function(error, bundle){\\n\\n if(error) throw error;\\n\\n one.save(target, bundle, function(error){\\n\\n if(error) throw error;\\n\\n console.log('path/to/package.json built and saved to path/to/bundle.js successfully!');\\n\\n });\\n\\n});\\n```\\n\\n#### Available Options\\n\\n* **noprocess:** do not include process module.\\n* **tie:** Registers given object path as a package. Usage: `tie: [{ 'module': 'pi', 'to': 'Math.PI' }, { 'module': 'json', 'to': 'JSON' }]`\\n* **exclude:** Exclude specified packages from build. Usage: `exclude: ['underscore', 'request']`\\n* **ignore:** Modules to ignore. .npmignore will not be read if this option is provided. Usage: `ignore: ['lib/foo.js', 'lib/path/to/a/directory']`\\n* **sandboxConsole:** Sandboxes console object. Disabled by default.\\n* **debug:** Enables debug mode. See the Debug Mode section above for information on the affects of this option.\\n\\n#### Applying Filters\\n\\nFiltering filenames might be a useful option for specific cases such as splitting build to different pieces. Here is an example usage;\\n\\n```javascript\\n\\nvar one = require('one');\\n\\none.modules.filters.push(function(filename){\\n\\n return filename.substring(0, 7) != 'lib/foo';\\n\\n});\\n\\n```\\n\\n# Troubleshooting\\n\\n* The most common issue of a OneJS output is to lack some dependencies. In that case, make sure that the library is located under `node_modules/` properly.\\n* Enabling verbose mode might be helpful: `onejs build package.json --verbose`\\n* See the content of `projectName.map` object if it contains the missing dependency\\n\\n# TESTING\\n\\nRun `npm test` for running all test modules. And run `make test module=?` for specific test modules;\\n\\n```bash\\n> make test module=build\\n```\\n'","npm_config_description":"true","npm_config_engine_strict":"","npm_config_https_proxy":"","npm_config_init_module":"/home/azer/.npm-init.js","npm_config_userconfig":"/home/azer/.npmrc","PWD":"/home/azer/dev/onejs","npm_config_npaturl":"http://npat.npmjs.org/","DIR_chessbench":"/home/azer/dev/chess-benchmark","JAVA_HOME":"/opt/java","npm_package_dependencies_log4js":"0.4.1","npm_config_node_version":"0.8.3","npm_config_user":"","npm_package_dependencies_mustache":"0.x","npm_lifecycle_event":"test","DIR_one":"/home/azer/dev/onejs","LANG":"en_US.UTF-8","npm_package_name":"one","npm_package_keywords_0":"build","npm_config_editor":"vi","npm_config_save":"","DIR_luke":"/home/azer/.config/wallpaper/images/luke","npm_package_keywords_1":"commonjs","npm_config_tag":"latest","DIR_mit":"/media/a/movie/mit","TZ":"US/Pacific","npm_package_keywords_2":"browser","npm_config_global":"","npm_config_username":"azer","DIR_resumes":"/home/azer/resumes","npm_package_bin_onejs":"./bin/onejs","npm_config_force":"","DIR_www":"/home/azer/www","npm_package_dependencies_genpkg":"0.x","npm_config_searchopts":"","DIR_chat":"/home/azer/dev/zen/zendesk_chat","PS3":"> ","npm_package_main":"./lib","npm_config_depth":"null","DIR_functools":"/home/azer/dev/functools","DIR_opt":"/home/azer/.opt","DIR_bin":"/home/azer/.local/bin","npm_package_version":"1.7.6","npm_config_rebuild_bundle":"true","npm_config_searchsort":"name","DIR_lowkick":"/home/azer/dev/lowkick","npm_config_unicode":"true","npm_config_yes":"","DIR_core":"/home/azer/dev/zen/zendesk_chat_core","COLORFGBG":"default;default","SHLVL":"6","PS4":"+ ","HOME":"/home/azer","DIR_drone":"/home/azer/dev/mac/drone","TERMINFO":"/usr/share/terminfo","XDG_CONFIG_HOME":"/home/azer/.config","npm_package_scripts_test":"./node_modules/highkick/bin/highkick test/main.js","npm_config_fetch_retry_maxtimeout":"60000","npm_config_ca":"'-----BEGIN CERTIFICATE-----\\nMIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC\\nVVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x\\nIjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w\\nbUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y\\nMTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV\\nBAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj\\nYXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA\\naXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE\\nOgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz\\nGn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl\\ny0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC\\nl7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv\\nyNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl\\nZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op\\n-----END CERTIFICATE-----'","npm_config_loglevel":"http","npm_config_strict_ssl":"true","DIR_delshare":"/home/azer/.local/share/delicious-surf","npm_config_dev":"","npm_config_fetch_retry_factor":"10","npm_config_group":"100","DIR_share":"/home/azer/.local/share","npm_config_cache_lock_stale":"60000","npm_config_version":"","DIR_hive":"/home/azer/dev/mac/hive","XDG_CACHE_HOME":"/home/azer/.cache","npm_config_cache_min":"","DIR_combiner":"/home/azer/dev/combiner","LOGNAME":"azer","npm_config_cache":"/home/azer/.npm","npm_config_searchexclude":"","DIR_neo4j":"/home/azer/opt/neo4j","npm_config_color":"true","npm_lifecycle_script":"./node_modules/highkick/bin/highkick test/main.js","DIR_debug":"/home/azer/dev/debug","XDG_DATA_DIRS":"/usr/local/share/:/usr/share/:/usr/local/share/:/usr/share/","J2SDKDIR":"/usr/lib/jvm/java-6-openjdk","npm_package_author_email":"azer@kodfabrik.com","npm_config_proxy":"","npm_config_save_optional":"","BROWSER":"delicious-surf","npm_config_user_agent":"npm/1.1.43 node/v0.8.3","DIR_zenchat":"/home/azer/dev/zen/zenchat","WINDOWPATH":"7","npm_config_cache_lock_wait":"10000","DIR_disko":"/media/disko","DISPLAY":":0","npm_package_dependencies_combiner":"1.2.x","npm_package_devDependencies_highkick":"1.x","npm_config_production":"","DIR_bookmarks":"/home/azer/bookmarks","npm_config_save_bundle":"","J2REDIR":"/usr/lib/jvm/java-6-openjdk/jre","npm_config_init_version":"0.0.0","npm_config_umask":"022","DIR_rap":"/media/a/music/rap","npm_package_dependencies_boxcars":"0.x","npm_config_git":"git","npm_config_init_author_name":"","DIR_jedi":"/media/a/music/rap/jedi","G_BROKEN_FILENAMES":"1","npm_package_directories_lib":"./lib","npm_config_onload_script":"","npm_config_tmp":"/home/azer/tmp","npm_config_unsafe_perm":"true","COLORTERM":"rxvt-xpm","XAUTHORITY":"/home/azer/.Xauthority","npm_config_link":"","npm_config_prefix":"/usr"};
exports.nextTick = function nextTick(fn){

@@ -371,22 +371,2 @@ return setTimeout(fn, 0);

});
exampleProject.pkg(3, function(parents){
return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, 1, function(parents){

@@ -445,2 +425,22 @@ return {

return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, function(parents){
return {
'id':7,

@@ -447,0 +447,0 @@ 'name':'vegetables',

@@ -300,22 +300,2 @@ var exampleProject = (function(global, undefined){

});
exampleProject.pkg(3, function(parents){
return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, 1, function(parents){

@@ -374,2 +354,22 @@ return {

return {
'id':4,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(4, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(3, function(parents){
return {
'id':7,

@@ -376,0 +376,0 @@ 'name':'vegetables',

@@ -355,22 +355,2 @@ var exampleProject = (function(global, undefined){

});
exampleProject.pkg(19, function(parents){
return {
'id':20,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(20, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(19, 18, function(parents){

@@ -429,2 +409,22 @@ return {

return {
'id':20,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(20, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(19, function(parents){
return {
'id':23,

@@ -431,0 +431,0 @@ 'name':'vegetables',

@@ -355,22 +355,2 @@ var exampleProject = (function(global, undefined){

});
exampleProject.pkg(2, function(parents){
return {
'id':3,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(3, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(2, 1, function(parents){

@@ -429,2 +409,22 @@ return {

return {
'id':3,
'name':'subdependency',
'main':undefined,
'mainModuleId':'i',
'modules':[],
'parents':parents
};
});
exampleProject.module(3, function(/* parent */){
return {
'id': 'i',
'pkg': arguments[0],
'wrapper': function(module, exports, global, Buffer,process,require, undefined){
require('sibling');
exports.i = true;
}
};
});
exampleProject.pkg(2, function(parents){
return {
'id':6,

@@ -431,0 +431,0 @@ 'name':'vegetables',

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