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

dir-to-object

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

dir-to-object

Builds an object from the files contained inside a directory.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.5K
increased by5.88%
Maintainers
1
Weekly downloads
 
Created
Source

dir-to-object

Builds an object from the files contained inside a directory.

Installation

npm install dir-to-object

Usage example

const dirToObject = require('dir-to-object');
const { join } = require('path');

const path = join(__dirname, './__mocks__/foo');

const options = { canAdd: () => true };

const bar = dirToObject(path, options);

console.log(bar);

Where path is a string and it is required:

e.g.: join(__dirname, './foo')

And where config is an object with the following property:

nametypeexamplerequired or optional
canAddfunction: (data) => booleandata => data.resolve && data.typeoptional

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

Distributed under the MIT license. See LICENSE for more information.

Keywords

FAQs

Package last updated on 19 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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