Skip to content

Commit

Permalink
chore: Begin normalizing repository
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jan 3, 2023
1 parent 1752090 commit f459288
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 409 deletions.
88 changes: 0 additions & 88 deletions .verb.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Jon Schlinkert
Copyright (c) 2015-2022 Jon Schlinkert <jon.schlinkert@sellside.com>, 2023 Blaine Bublitz <blaine.bublitz@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 0 additions & 15 deletions examples.js

This file was deleted.

27 changes: 1 addition & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"is-negated-glob": "^1.0.0"
},
"devDependencies": {
"gulp-format-md": "^2.0.0",
"mocha": "^3.0.2"
},
"keywords": [
Expand All @@ -44,29 +43,5 @@
"pattern",
"resolve",
"to"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"lint": {
"reflinks": true
},
"related": {
"list": [
"has-glob",
"is-glob",
"is-valid-glob"
]
},
"reflinks": [
"verb",
"verb-generate-readme"
]
}
]
}
96 changes: 15 additions & 81 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,11 @@

> Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
## Install

Install with [npm](https://www.npmjs.com/):

```sh
npm install to-absolute-glob
```


Or install with [yarn](https://yarnpkg.com/):

```sh
yarn add to-absolute-glob
```

## Usage

```js
const toAbsGlob = require('to-absolute-glob');
toAbsGlob('a/*.js');
const toAbsGlob = require("to-absolute-glob");
toAbsGlob("a/*.js");
//=> '/dev/foo/a/*.js'
```

Expand All @@ -32,131 +17,80 @@ Given the current project folder (cwd) is `/dev/foo/`:
**makes a path absolute**

```js
toAbsGlob('a');
toAbsGlob("a");
//=> '/dev/foo/a'
```

**makes a glob absolute**

```js
toAbsGlob('a/*.js');
toAbsGlob("a/*.js");
//=> '/dev/foo/a/*.js'
```

**retains trailing slashes**

```js
toAbsGlob('a/*/');
toAbsGlob("a/*/");
//=> '/dev/foo/a/*/'
```

**retains trailing slashes with cwd**

```js
toAbsGlob('./fixtures/whatsgoingon/*/', {cwd: __dirname});
//=> '/dev/foo/'
toAbsGlob("./fixtures/whatsgoingon/*/", { cwd: __dirname });
//=> '/dev/foo/fixtures/whatsgoingon/*/'
```

**makes a negative glob absolute**

```js
toAbsGlob('!a/*.js');
toAbsGlob("!a/*.js");
//=> '!/dev/foo/a/*.js'
```

**from a cwd**

```js
toAbsGlob('a/*.js', {cwd: 'foo'});
toAbsGlob("a/*.js", { cwd: "foo" });
//=> '/dev/foo/foo/a/*.js'
```

**makes a negative glob absolute from a cwd**

```js
toAbsGlob('!a/*.js', {cwd: 'foo'});
toAbsGlob("!a/*.js", { cwd: "foo" });
//=> '!/dev/foo/foo/a/*.js'
```

**from a root path**

```js
toAbsGlob('/a/*.js', {root: 'baz'});
toAbsGlob("/a/*.js", { root: "baz" });
//=> '/dev/foo/baz/a/*.js'
```

**from a root slash**

```js
toAbsGlob('/a/*.js', {root: '/'});
toAbsGlob("/a/*.js", { root: "/" });
//=> '/dev/foo/a/*.js'
```

**from a negative root path**

```js
toAbsGlob('!/a/*.js', {root: 'baz'});
toAbsGlob("!/a/*.js", { root: "baz" });
//=> '!/dev/foo/baz/a/*.js'
```

**from a negative root slash**

```js
toAbsGlob('!/a/*.js', {root: '/'});
toAbsGlob("!/a/*.js", { root: "/" });
//=> '!/dev/foo/a/*.js'
```

## About

### Related projects

* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.")
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob "Return true if a value is a valid glob pattern or patterns.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors

| **Commits** | **Contributor**<br/> |
| --- | --- |
| 16 | [doowb](https://github.com/doowb) |
| 15 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [phated](https://github.com/phated) |
| 1 | [erikkemperman](https://github.com/erikkemperman) |

### Building docs

_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_

To generate the readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install -g verb verb-generate-readme && verb
```

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

### License

Copyright (c) [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/to-absolute-glob/blob/master/LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v3.0.0, on November 17, 2022._
MIT

0 comments on commit f459288

Please sign in to comment.