You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ls

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ls - npm Package Compare versions

Comparing version

to
0.1.0

.npmignore

34

lib/ls.js

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

// Generated by CoffeeScript 1.4.0
// Generated by CoffeeScript 1.7.1
(function() {
var fs, list;
var fs, glob, list, path;
fs = require('fs');
glob = require('glob');
path = require('path');
/**

@@ -14,7 +19,6 @@ * @param {Array} paths Path or array of paths to iterate over

* @return {Array} Files found
*/
*/
module.exports = list = function() {
var args, config, iterator, path, paths, results, _ref, _ref1;
var args, config, iterator, paths, results, trypath;
args = Array.prototype.slice.call(arguments);

@@ -26,6 +30,6 @@ paths = args.shift();

config = typeof args[0] === 'object' && Object.keys(args[0]).length ? args.shift() : {};
if ((_ref = config.recurse) == null) {
if (config.recurse == null) {
config.recurse = false;
}
if ((_ref1 = config.match) == null) {
if (config.match == null) {
config.match = args[0] instanceof RegExp ? args.shift() : null;

@@ -37,10 +41,12 @@ }

results = [];
while (path = paths.shift()) {
fs.readdirSync(path).sort().forEach(function(file) {
var self, _ref2;
while (trypath = paths.shift()) {
glob.sync(trypath, {
nonegate: true
}).forEach(function(file) {
var self;
self = {
path: path,
full: "" + path + "/" + file,
file: file,
name: (_ref2 = file.match(/^(.+?)(\.\w{2,7})?$/)) != null ? _ref2[1] : void 0
path: path.dirname(file),
full: file,
file: path.basename(file),
name: path.basename(file, path.extname(file))
};

@@ -47,0 +53,0 @@ Object.defineProperty(self, "stat", {

@@ -1,15 +0,18 @@

{ "name" : "ls"
, "description" : "Cleanly traverse directories in Coffeescript & Javascript"
, "author" : "Awnist <hi@awnist.com> (http://awnist.com)"
, "version" : "0.0.2"
, "main" : "./lib/ls"
, "repository" :
{ "type" : "git"
, "url" : "http://github.com/awnist/ls.git"
{
"name": "ls",
"description": "Cleanly traverse directories in node",
"author": "Awnist <hi@awnist.com> (http://awnist.com)",
"version": "0.1.0",
"main": "./lib/ls",
"repository": {
"type": "git",
"url": "http://github.com/awnist/ls.git"
},
"license": {
"type": "Public Domain",
"url": "http://unlicense.org/"
},
"dependencies": {
"glob": "~4.0.2"
}
, "license" :
{ "type" : "Public Domain"
, "url" : "http://unlicense.org/"
}
}
## What's "ls"?
ls is a Coffeescript and Javascript module for cleanly traversing directories and listing files.
ls is a node module for cleanly traversing directories and listing files.
It has flexible and variable length arguments.
The primary goal is a flexible, expressive syntax.

@@ -20,3 +20,3 @@ ## Overview

ls ["/path", "/another/path/"], { recurse: true }, /jpg/, ->
ls ["/path/foo*", "/another/path/"], { recurse: true }, /jpg/, ->
console.log @name, "is in", @path, "and is", @stat.size

@@ -23,0 +23,0 @@