Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
require a folder/file without the pain
Let's image the following repository's structure:
.
├── server
│ ├── controllers
│ │ ├── user.js
│ │ └── org_user.js
│ ├── helpers
│ │ └── assets.js
│ └── index.js
├── config
│ ├── env
│ │ ├── development.js
│ │ └── staging.js
│ ├── providers.json
│ └── index.js
└── server.js
In your root file A.K.A. /server.js:
// you can choose the name you want.
global.multiPath = filepath => require('multi-path')( __dirname + filepath )
multiPath
function is now available from anywhere in our application.
you can require files like this:
/server/controllers/user.js
const Helpers = multiPath('/server/helpers')
, Assets = Helpers.Assets
, OrgUser = multiPath('/server/controllers/org_user')
, Providers = multiPath('/config/providers')
, Config = multiPath('/config')
console.log(Assets)
console.log(OrgUser)
console.log(Providers)
console.log(Config)
this will output:
{ create: [Function],
read: [Function],
update: [Function],
delete: [Function] }
[Function]
{"foo": "bar"}
{"baz": "yolo"}
FAQs
require a folder/file without the pain
The npm package multi-path receives a total of 2 weekly downloads. As such, multi-path popularity was classified as not popular.
We found that multi-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.