
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
file-getter
Advanced tools
向上查找,获取文件对应路径。
获取使用的npm包所在路径。
Get the file path of the filename or the npm package.
fs 模块;path 模块。npm install file-getter
yarn add file-getter
pnpm add file-getter
import { file_getter, get_pkg_path } from 'file-getter';
file_getter('test.js');
//=>./test.js
file_getter('test2.js');
//=> /xxx/test2.js
get_pkg_path('vue');
//=> xxx/node_modules/vue/package.json
import { file_getter } from 'file-getter';
// 查找上级目录中,是否有 ./src/test.js 文件
file_getter('test.js', {
relativeFileDir: 'src'
});
//=> /user/test/src/test.js
import { file_getter } from 'file-getter';
// 查找上级目录中,是否有 ./src/test.js 文件
file_getter('test.js', {
searchPath: 'src'
});
//=> /user/test/src/test.js
FAQs
The npm package file-getter receives a total of 4 weekly downloads. As such, file-getter popularity was classified as not popular.
We found that file-getter 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
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.