Socket
Socket
Sign inDemoInstall

parse-gitignore

Package Overview
Dependencies
4
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-gitignore

Parse a gitignore file into an array of patterns. Comments and empty lines are stripped.


Version published
Weekly downloads
459K
increased by9.88%
Maintainers
1
Install size
54.9 kB
Created
Weekly downloads
 

Readme

Source

parse-gitignore NPM version Build Status

Parse a gitignore file into an array of patterns. Comments and empty lines are stripped.

Install with npm

npm i parse-gitignore --save

Usage

var gitignore = require('parse-gitignore');

// pass a string
var str = fs.readFileSync('.gitignore', 'utf8');
gitignore(str);
//=> ['*.DS_Store', 'node_modules', ...]

Pass additional patterns

Since the function already does unique-ifying, you can optionally pass an array of patterns to combine additional patterns to whatever is in .gitignore and get an array of unique patterns:

gitignore(str, ['foo', 'bar']);
//=> ['*.DS_Store', 'node_modules', 'foo', 'bar', ...]

Run 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 (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on February 27, 2015.

Keywords

FAQs

Last updated on 27 Feb 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc