
Security News
Federal Government Rescinds Software Supply Chain Mandates, Makes SBOMs Optional
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Given a search string and a list of file paths, find the closest path.
Install with npm:
npm i find-path --save
Type: Boolean
Default value: false
This returns all of the found paths instead of the "nearest" path.
Find the nearest path for the provided search string.
var findPath = require('find-path');
var search = 'index';
var paths = [
'foo/bar/baz/about.md',
'foo/bar/baz/index.md',
'foo/bar/about.md',
'foo/bar/index.md',
'foo/about.md',
'foo/index.md'
];
var foundPath = findPath(search, paths);
console.log('foundPath: ', foundPath);
Outputs 'foundPath: foo/index.md'
Find all paths for the provided search string.
var findPath = require('find-path');
var options = {
all: true
};
var search = 'index';
var paths = [
'foo/bar/baz/about.md',
'foo/bar/baz/index.md',
'foo/bar/about.md',
'foo/bar/index.md',
'foo/about.md',
'foo/index.md'
];
var foundPaths = findPath(search, paths, options);
console.log('foundPaths: ', foundPaths);
Outputs 'foundPaths: foo/bar/baz/index.md,foo/bar/index.md/foo/index.md'
Copyright (c) 2014 Brian Woodward, contributors. Released under the MIT license
This file was generated by verb-cli on March 22, 2014.
FAQs
Gets the first matching path from an array of file paths.
The npm package find-path receives a total of 4 weekly downloads. As such, find-path popularity was classified as not popular.
We found that find-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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 U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.