
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Find the parent directory for top level projects.
npm install code-dir --save
Get it into your program.
const codeDir = require('code-dir');
Find the directory where the end user stores their projects.
codeDir().then((dirPath) => {
console.log(dirPath); // => '/Users/sholladay/Code/personal'
});
Returns a Promise for the path of the topmost project's parent directory. A project is a directory that contains either .git or package.json.
Type: string
Default: process.cwd()
Current working directory the search is based on. This is the deepest directory that could be returned. If neither it nor any of its parent directories are projects, then as a last resort, its children are checked to determine if any of them are projects, in case the working directory itself is the code directory, since that is a common case.
See our contributing guidelines for more details.
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureGo make something, dang it.
FAQs
Find the parent directory for top level projects.
We found that code-dir 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.