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

ls-fs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ls-fs - npm Package Compare versions

Comparing version 1.0.2 to 1.1.2

lib/require-dir.js

1

lib/ls-fs.js

@@ -6,4 +6,5 @@ 'use strict';

module.exports = _.safeMerge(require('./tmp'), {
requireDir: require('./require-dir'),
readJson: require('./read-json'),
writeJson: require('./write-json')
});

6

package.json
{
"name": "ls-fs",
"version": "1.0.2",
"version": "1.1.2",
"description": "Some file utilities",

@@ -29,6 +29,8 @@ "main": "lib/ls-fs.js",

"dependencies": {
"callsite": "^1.0.0",
"ls-lodash": "^1.0.0",
"q": "^1.1.2",
"q-io": "^1.11.6",
"tmp": "0.0.24"
"tmp": "0.0.24",
"underscore.string": "^2.4.0"
},

@@ -35,0 +37,0 @@ "repository": {

@@ -59,1 +59,35 @@ # ls-fs [![Build Status](https://travis-ci.org/LiveSafe/ls-fs.svg?branch=master)](https://travis-ci.org/LiveSafe/ls-fs)

### requireDir
Takes a path to a directory and returns an object containing all the `require`d modules in that directory.
For example, if you have a directory with:
```
some-module.js
other-module.js
static-content.json
```
`requireDir` on that directory would return an object like:
```
{
someModule: <module.exports of some-module.js>,
...
}
```
###### Usage
```js
lsFs.requireDir(pathToDir).then(function(requiredDirObj) {
// use required modules
});
```
###### Arguments
1. `pathToDir` _(String)_ Path to the directory you would like to recursively require
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