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

one

Package Overview
Dependencies
Maintainers
1
Versions
216
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 2.5.0 to 2.5.2

4

lib/dependencies.js

@@ -1,4 +0,4 @@

var path = require('path'),
var debug = require('./debug')('dependencies'),
path = require('path'),
readdir = require('fs').readdir,
debug = require('./debug')('dependencies'),
manifest = require('./manifest'),

@@ -5,0 +5,0 @@ excludeds = require('./excludeds'),

@@ -1,5 +0,4 @@

var boxcars = require('boxcars'),
path = require('path'),
fs = require("fs"),
debug = require('./debug')('manifest');
var debug = require('./debug')('manifest'),
path = require('path'),
fs = require("fs");

@@ -66,3 +65,3 @@ function paths(pkg, dir){

boxcars(filename)(function(error, bf){
fs.readFile(filename, function(error, bf){

@@ -78,11 +77,7 @@ if(error){

try {
manifest = JSON.parse(bf);
manifest = JSON.parse(bf.toString());
debug('Manifest file "%s" loaded and parsed successfully.', filename);
} catch(exc) {
debug('Failed to parse the manifest @ "%s"', filename);
error = exc;
}

@@ -89,0 +84,0 @@

@@ -1,16 +0,21 @@

var functools = require('functools'),
var debug = require('./debug')('modules'),
flatten = require('flatten-array'),
functools = require('functools'),
compose = functools.compose,
combiner = require('combiner'),
glob = require('glob'),
path = require('path'),
readFile = require('fs').readFile,
readFile = require('fs').readFile;
debug = require('./debug')('modules');
var filters = [],
toInclude = [];
function pass(f, cb){
return cb(undefined, f);
}
module.exports = modules;
module.exports.filterFilename = filterFilename;
module.exports.loadModule = loadModule;
module.exports.loadModules = loadModules;
module.exports.fixname = fixname;
module.exports.filters = filters;
module.exports.toInclude = toInclude;

@@ -28,3 +33,3 @@ function filter(filenames, callback){

callback(undefined, copy);
return copy;
}

@@ -37,42 +42,36 @@

function filterFilenames(filenames, callback){
callback(undefined, filenames.filter(filterFilename));
return filenames.filter(filterFilename);
}
function filterIgnoredModules(pkg){
return function(filenames, callback){
function filterIgnoredModules(pkg, filenames){
if(!pkg.ignore) return filenames;
if(!pkg.ignore){
callback(undefined, filenames);
return;
}
var f = filenames.length,
i, ignore, filename,
ignored, result = [];
var f = filenames.length,
i, ignore, filename,
ignored, result = [];
while( f -- ){
ignored = false;
while( f -- ){
ignored = false;
i = pkg.ignore.length;
filename = filenames[f].substring(pkg.wd.length + ( pkg.wd.substring(pkg.wd.length-1) != '/' ? 1 : 0 ));
i = pkg.ignore.length;
filename = filenames[f].substring(pkg.wd.length + ( pkg.wd.substring(pkg.wd.length-1) != '/' ? 1 : 0 ));
while( i -- ){
while( i -- ){
ignore = pkg.ignore[i];
ignore = pkg.ignore[i];
if( filename.substring( 0, ignore.length ) == ignore ){
debug('Module "%s" is ignored by the line "%s" at .npmignore', filename, ignore);
ignored = true;
break;
}
if( filename.substring( 0, ignore.length ) == ignore ){
debug('Module "%s" is ignored by the line "%s" at .npmignore', filename, ignore);
ignored = true;
break;
}
}
}
!ignored && result.push( filenames[f] );
!ignored && result.push( filenames[f] );
}
}
return result;
callback(undefined, result);
};
}

@@ -114,45 +113,38 @@

function loadModules(pkg, base){
function loadModules(pkg, base, filenames, callback){
debug('Found '+filenames.length+' file(s) under the package "'+pkg.name+'"');
return function(filenames, callback){
debug('Found '+filenames.length+' file(s) under the package "'+pkg.name+'"');
var modules = [];
var modules = [];
(function next(i){
if(i>=filenames.length){
debug('Loaded %d module(s) under the package "%s"',filenames.length,pkg.name);
callback(undefined, modules);
(function next(i){
if(i>=filenames.length){
debug('Loaded %d module(s) under the package "%s"',filenames.length,pkg.name);
callback(undefined, modules);
return;
}
loadModule(filenames[i], function(error, module){
if(error){
debug('Failed to load the module "'+filenames[i]+'"');
callback(error);
return;
}
loadModule(filenames[i], function(error, module){
if(error){
debug('Failed to load the module "'+filenames[i]+'"');
callback(error);
return;
}
//replacing '\' with '/' for Windows based systems
module.filename = module.filename.replace(/\\/g,'/');
module.filename = module.filename.replace(base+'/', '');
module.filename.indexOf('/') > 0 && base != '.' && ( module.filename = module.filename.replace(base, '') );
module.id = module.filename.replace(/\.js$/,'');
//replacing '\' with '/' for Windows based systems
module.filename = module.filename.replace(/\\/g,'/');
module.filename = module.filename.replace(base+'/', '');
module.filename.indexOf('/') > 0 && base != '.' && ( module.filename = module.filename.replace(base, '') );
module.id = module.filename.replace(/\.js$/,'');
if(!error) modules.push(module);
if(!error) modules.push(module);
next(i+1);
next(i+1);
});
});
})(0);
};
})(0);
}
function include(files, cb){
cb(undefined, files.concat(toInclude));
}
function modules(pkg, options, callback){

@@ -184,18 +176,11 @@ debug('Collect modules for the package "'+pkg.name+'"');

compose.async(combiner.findFiles,
pkg.parents && pkg.parents.length == 0 && include || pass,
combiner.includeDirectories,
combiner.flatten,
filterFilenames,
filterIgnoredModules(pkg),
filter,
loadModules(pkg, base))(dirs, callback);
var files = filterIgnoredModules(pkg, filter(filterFilenames(flatten(dirs.map(function(el){
return glob.sync(el + '/**/*.js').concat(glob.sync(el));
})))));
if(pkg.parents && pkg.parents.length){
dirs = dirs.concat(toInclude);
}
loadModules(pkg, base, files, callback);
}
module.exports = modules;
module.exports.filterFilename = filterFilename;
module.exports.loadModule = loadModule;
module.exports.loadModules = loadModules;
module.exports.fixname = fixname;
module.exports.filters = filters;
module.exports.toInclude = toInclude;

@@ -10,3 +10,3 @@ var pkg = require('../package'),

function main(pkg, options, callback){
var layout = options.plain ? plain : dynamic;
var layout = dynamic;

@@ -13,0 +13,0 @@ var async = {},

@@ -1,1 +0,7 @@

module.exports = new Error('Not Implemented');
var debug = require("../../debug")('one:static');
module.exports = bundle;
function bundle(){
console.log(arguments);
}
{
"name": "one",
"version": "2.5.0",
"version": "2.5.2",
"description": "Transform NodeJS packages into single stand-alone script files.",
"author": "Azer Koculu <azer@kodfabrik.com>",
"keywords": [
"build",
"commonjs",

@@ -21,7 +20,7 @@ "browser"

"optimist": "0.x",
"combiner": "1.2.x",
"hogan.js": "2.x",
"log4js": "0.6.x",
"boxcars": "0.x",
"debug": "*"
"glob": "*",
"debug": "*",
"flatten-array": "*",
"boxcars": "*"
},

@@ -28,0 +27,0 @@ "devDependencies": {

@@ -8,11 +8,2 @@ OneJS is a command-line utility for converting CommonJS packages to single, stand-alone JavaScript

# MOTIVATION
* **Reusability** OneJS lets developers code JavaScript for one platform and run everywhere, without requiring any additional effort.
* **Elegant Modularization** Modules and packages specs of CommonJS are what web apps exactly needs: a well designed way to structure your source code.
* **NPM** OneJS moves the revolution of NPM one step forward and makes it available for client-side projects!
* **No Spaghetti Code** No awkward headers, no framework-specific definitions.
* **Reliable code generation** OneJS doesn't change your source code. It generates a container that emulates a simple NodeJS environment.
* **Unobtrusive Code** OneJS puts all the content into an isolated JS object.
![](https://dl.dropbox.com/s/r29fc29iip3mj8u/onejs.jpg)

@@ -19,0 +10,0 @@

Sorry, the diff of this file is not supported yet

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