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

match-file

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

match-file

Returns true when the given `name` matches any of the path properties on a vinyl file

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
decreased by-3.73%
Maintainers
1
Weekly downloads
 
Created
Source

match-file NPM version Build Status

Returns true when the given name matches any of the path properties on a vinyl file

(TOC generated by verb using markdown-toc)

Install

Install with npm:

$ npm i match-file --save

Usage

var matchFile = require('match-file');
var File = require('vinyl');
var file = new File({path: 'a/b/c.txt', base: 'a'});

var isMatch = matchFile('c.txt', file);
//=> true (since `c.txt` matches file.basename)

Examples

Continuing with the above setup code, each of the following would return true:

// file.path
matchFile('a/b/c.txt', file);
// file.relative
matchFile('b/c.txt', file);
// file.basename
matchFile('c.txt', file);
// file.stem
matchFile('c', file);
  • assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
  • gulp: The streaming build system | homepage
  • templates: System for creating and managing template collections, and rendering templates with any node.js template engine.… more | homepage
  • verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage
  • vinyl: A virtual file format | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb on January 21, 2016.

Keywords

FAQs

Package last updated on 21 Jan 2016

Did you know?

Socket

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.

Install

Related posts

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