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

dotfile-regex

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

dotfile-regex - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

LICENSE

6

index.js
/*!
* dotfile-regex <https://github.com/regexps/dotfile-regex>
*
* Copyright (c) 2015 Jon Schlinkert, contributors.
* Licensed under the MIT license.
* Copyright (c) 2015-2017, Jon Schlinkert.
* Released under the MIT License.
*/

@@ -11,3 +11,3 @@

module.exports = function dotfileRegex() {
return /(?:\/|^)(\.[^\/]*)$/;
return /(?:^|[\\\/])(\.(?!\.)[^\\\/]+)$/;
};
{
"name": "dotfile-regex",
"description": "Regular expresson for matching dotfiles.",
"version": "0.1.2",
"version": "1.0.0",
"homepage": "https://github.com/regexps/dotfile-regex",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"repository": {
"type": "git",
"url": "git://github.com/regexps/dotfile-regex.git"
},
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Haoliang Gao (chuo.me)",
"John Otander (http://johnotander.com)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Sindre Sorhus (https://sindresorhus.com)"
],
"repository": "regexps/dotfile-regex",
"bugs": {
"url": "https://github.com/regexps/dotfile-regex/issues"
},
"license": {
"type": "MIT",
"url": "https://github.com/regexps/dotfile-regex/blob/master/LICENSE-MIT"
},
"main": "index.js",
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {

@@ -29,6 +26,7 @@ "node": ">=0.10.0"

"scripts": {
"test": "mocha -R spec"
"test": "mocha"
},
"devDependencies": {
"mocha": "*"
"gulp-format-md": "^0.1.12",
"mocha": "^3.4.2"
},

@@ -44,3 +42,23 @@ "keywords": [

"regular"
]
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"dotdir-regex",
"is-dotdir",
"is-dotfile"
]
},
"lint": {
"reflinks": true
}
}
}

@@ -1,9 +0,11 @@

# dotfile-regex [![NPM version](https://badge.fury.io/js/dotfile-regex.svg)](http://badge.fury.io/js/dotfile-regex)
# dotfile-regex [![NPM version](https://img.shields.io/npm/v/dotfile-regex.svg?style=flat)](https://www.npmjs.com/package/dotfile-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/dotfile-regex.svg?style=flat)](https://npmjs.org/package/dotfile-regex) [![NPM total downloads](https://img.shields.io/npm/dt/dotfile-regex.svg?style=flat)](https://npmjs.org/package/dotfile-regex) [![Linux Build Status](https://img.shields.io/travis/regexps/dotfile-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexps/dotfile-regex)
> Regular expresson for matching dotfiles.
## Install with [npm](npmjs.org)
## Install
```bash
npm i dotfile-regex --save
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save dotfile-regex
```

@@ -13,37 +15,76 @@

To be considered a dotfile, there cannot be any slashes following the filename.
```js
var dotfileRe = require('dotfile-regex');
var dotfileRegex = require('dotfile-regex');
var match = re.exec('a/b/c/d/.gitignore');
// match[0] => '/.gitignore'
// match[1] => '.gitignore'
dotfileRegex().test('a/b/c.js');
//=> false
dotfileRe().test('a/b/c.js');
dotfileRegex().test('./git');
//=> false
dotfileRegex().test('.git/foo');
//=> false
dotfileRegex().test('.gitignore');
//=> true
dotfileRegex().test('a/b/c/.gitignore');
//=> true
```
## Run tests
## About
Install dev dependencies:
### Related projects
```bash
node i -d && mocha
* [dotdir-regex](https://www.npmjs.com/package/dotdir-regex): Regex for matching dot-directories, like `.git/` | [homepage](https://github.com/regexps/dotdir-regex "Regex for matching dot-directories, like `.git/`")
* [is-dotdir](https://www.npmjs.com/package/is-dotdir): Returns true if a path is a dot-directory. | [homepage](https://github.com/jonschlinkert/is-dotdir "Returns true if a path is a dot-directory.")
* [is-dotfile](https://www.npmjs.com/package/is-dotfile): Return true if a file path is (or has) a dotfile. Returns false if the… [more](https://github.com/jonschlinkert/is-dotfile) | [homepage](https://github.com/jonschlinkert/is-dotfile "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 3 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [popomore](https://github.com/popomore) |
| 1 | [johnotander](https://github.com/johnotander) |
| 1 | [sindresorhus](https://github.com/sindresorhus) |
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/regexps/dotfile-regex/issues)
### Running tests
## Author
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb](https://github.com/assemble/verb) on January 21, 2015._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 30, 2017._
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