Socket
Socket
Sign inDemoInstall

require-camelcase

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    require-camelcase

require all files in folder and export a object with camel case keys


Version published
Maintainers
1
Install size
10.3 kB
Created

Readme

Source

require-camelcase

require all files in folder and export a object with camel case keys.

Usage

Imagine that you have a folder structure like this

	helpers
	---- parse-json.js
	---- api-erros.js
	---- validate.js
const requiredFiles = require('require-camelcase')(__dirname)

/*
requiredFiles = {
	parseJson: [Function parseJson],
	apiErros: { .... },
	validate: [Function validade]
}
*/

require files function

/**
 * generates object with all files in folder
 * @function
 * @param {string} dir - path of files default is __dirname
 */
 requireFiles( __dirname || path )

Notes

Obviously because it is a module that exposes methods, functions, objects necessary for its application, it does so synchronously.

FAQs

Last updated on 28 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc