@types/find-pkg 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- find-pkg/LICENSE +21 -0
- find-pkg/README.md +68 -0
- find-pkg/index.d.ts +49 -0
- find-pkg/package.json +31 -0
find-pkg/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
find-pkg/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/find-pkg`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for find-pkg (https://github.com/jonschlinkert/find-pkg).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/find-pkg.
|
|
9
|
+
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/find-pkg/index.d.ts)
|
|
10
|
+
````ts
|
|
11
|
+
/**
|
|
12
|
+
* Find the first directory with a package.json, recursing up from the given directory.
|
|
13
|
+
*
|
|
14
|
+
* @param cwd - The directory to start searching from
|
|
15
|
+
* @returns A promise that resolves to the path of the found package.json, or undefined if not found
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```javascript
|
|
19
|
+
* const findPkg = require('find-pkg');
|
|
20
|
+
*
|
|
21
|
+
* findPkg('a/b/c/some/path')
|
|
22
|
+
* .then(file => console.log(file))
|
|
23
|
+
* .catch(console.error);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function findPkg(cwd: string): Promise<string | undefined>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Find the first directory with a package.json, recursing up from the given directory.
|
|
30
|
+
*
|
|
31
|
+
* @param cwd - The directory to start searching from
|
|
32
|
+
* @param callback - Callback function called with (err, filepath)
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```javascript
|
|
36
|
+
* findPkg('a/b/c/some/path', function(err, file) {
|
|
37
|
+
* if (err) throw err;
|
|
38
|
+
* console.log(file);
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function findPkg(cwd: string, callback: (err: Error | null, file: string | undefined) => void): void;
|
|
43
|
+
|
|
44
|
+
declare namespace findPkg {
|
|
45
|
+
/**
|
|
46
|
+
* Synchronously find the first directory with a package.json, recursing up from the given directory.
|
|
47
|
+
*
|
|
48
|
+
* @param cwd - The directory to start searching from
|
|
49
|
+
* @returns The path of the found package.json, or undefined if not found
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```javascript
|
|
53
|
+
* const file = findPkg.sync('a/b/c/some/path');
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
function sync(cwd: string): string | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export = findPkg;
|
|
60
|
+
|
|
61
|
+
````
|
|
62
|
+
|
|
63
|
+
### Additional Details
|
|
64
|
+
* Last updated: Thu, 05 Feb 2026 08:45:22 GMT
|
|
65
|
+
* Dependencies: none
|
|
66
|
+
|
|
67
|
+
# Credits
|
|
68
|
+
These definitions were written by [Jon Schlinkert](https://github.com/jonschlinkert), and [gaspard](https://github.com/gasp).
|
find-pkg/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the first directory with a package.json, recursing up from the given directory.
|
|
3
|
+
*
|
|
4
|
+
* @param cwd - The directory to start searching from
|
|
5
|
+
* @returns A promise that resolves to the path of the found package.json, or undefined if not found
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```javascript
|
|
9
|
+
* const findPkg = require('find-pkg');
|
|
10
|
+
*
|
|
11
|
+
* findPkg('a/b/c/some/path')
|
|
12
|
+
* .then(file => console.log(file))
|
|
13
|
+
* .catch(console.error);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare function findPkg(cwd: string): Promise<string | undefined>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Find the first directory with a package.json, recursing up from the given directory.
|
|
20
|
+
*
|
|
21
|
+
* @param cwd - The directory to start searching from
|
|
22
|
+
* @param callback - Callback function called with (err, filepath)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* findPkg('a/b/c/some/path', function(err, file) {
|
|
27
|
+
* if (err) throw err;
|
|
28
|
+
* console.log(file);
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare function findPkg(cwd: string, callback: (err: Error | null, file: string | undefined) => void): void;
|
|
33
|
+
|
|
34
|
+
declare namespace findPkg {
|
|
35
|
+
/**
|
|
36
|
+
* Synchronously find the first directory with a package.json, recursing up from the given directory.
|
|
37
|
+
*
|
|
38
|
+
* @param cwd - The directory to start searching from
|
|
39
|
+
* @returns The path of the found package.json, or undefined if not found
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```javascript
|
|
43
|
+
* const file = findPkg.sync('a/b/c/some/path');
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
function sync(cwd: string): string | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export = findPkg;
|
find-pkg/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@types/find-pkg",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "TypeScript definitions for find-pkg",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/find-pkg",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Jon Schlinkert",
|
|
10
|
+
"githubUsername": "jonschlinkert",
|
|
11
|
+
"url": "https://github.com/jonschlinkert"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "gaspard",
|
|
15
|
+
"githubUsername": "gasp",
|
|
16
|
+
"url": "https://github.com/gasp"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"main": "",
|
|
20
|
+
"types": "index.d.ts",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
24
|
+
"directory": "types/find-pkg"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {},
|
|
27
|
+
"dependencies": {},
|
|
28
|
+
"peerDependencies": {},
|
|
29
|
+
"typesPublisherContentHash": "f76465eaf7e844a2fc856fb7ac1a62e6a93c1c59011a9a0a7ff54fe56fba5902",
|
|
30
|
+
"typeScriptVersion": "5.2"
|
|
31
|
+
}
|