Skip to content

Commit

Permalink
Readme tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jul 5, 2019
1 parent 878ef6e commit 5b0834a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 18 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ interface Gitignore {

declare const globby: {
/**
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
Find files and directories using glob patterns.
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns The matching paths.
Expand All @@ -102,7 +106,11 @@ declare const globby: {
): Promise<string[]>;

/**
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
Find files and directories using glob patterns.
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns The matching paths.
*/
Expand All @@ -112,7 +120,11 @@ declare const globby: {
): string[];

/**
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
Find files and directories using glob patterns.
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns The stream of matching paths.
Expand All @@ -135,9 +147,9 @@ declare const globby: {
/**
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones in this package.
@returns Object in the format `{ pattern: string, options: Object }`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
@returns An object in the format `{pattern: string, options: object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
*/
generateGlobTasks(
patterns: string | readonly string[],
Expand All @@ -149,7 +161,7 @@ declare const globby: {
This function is backed by [`node-glob`](https://github.com/isaacs/node-glob#globhasmagicpattern-options).
@param patterns - See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`node-glob` options](https://github.com/isaacs/node-glob#globhasmagicpattern-options).
@returns Whether there are any special glob characters in the `patterns`.
*/
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const globby = require('globby');

## API

Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.

### globby(patterns, options?)

Returns a `Promise<string[]>` of matching paths.
Expand Down

0 comments on commit 5b0834a

Please sign in to comment.