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

@coderich/util

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coderich/util - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

package.json
{
"name": "@coderich/util",
"main": "src/index.js",
"version": "0.1.4",
"version": "0.1.5",
"publishConfig": {

@@ -6,0 +6,0 @@ "access": "public"

@@ -0,1 +1,3 @@

const FS = require('fs');
const Path = require('path');
const ChildProcess = require('child_process');

@@ -16,2 +18,3 @@ const ObjectId = require('bson-objectid');

exports.timeout = ms => new Promise((resolve) => { setTimeout(resolve, ms); });
exports.ucFirst = string => string.charAt(0).toUpperCase() + string.slice(1);

@@ -131,1 +134,20 @@ exports.filterRe = (arr, fn) => {

};
exports.requireDir = (dir) => {
const data = {};
dir = Path.resolve(dir);
FS.readdirSync(dir).forEach((filename) => {
const { name } = Path.parse(filename);
const path = `${dir}/${filename}`;
const stat = FS.statSync(path);
if (stat && stat.isDirectory()) {
data[name] = exports.requireDir(path);
} else if (path.includes('.js')) {
data[name] = require(path); // eslint-disable-line import/no-dynamic-require, global-require
}
});
return data;
};
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