File: README.md

package info (click to toggle)
node-validate-npm-package-name 5.0.0%2B~4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 220 kB
  • sloc: javascript: 167; makefile: 2
file content (55 lines) | stat: -rwxr-xr-x 1,856 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Installation
> `npm install --save @types/validate-npm-package-name`

# Summary
This package contains type definitions for validate-npm-package-name (https://github.com/npm/validate-npm-package-name).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validate-npm-package-name.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validate-npm-package-name/index.d.ts)
````ts
// Type definitions for validate-npm-package-name 4.0
// Project: https://github.com/npm/validate-npm-package-name
// Definitions by: Florian Keller <https://github.com/ffflorian>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace validate {
    interface Results {
        validForNewPackages: boolean;
        validForOldPackages: boolean;
        errors?: string[] | undefined;
        warnings?: string[] | undefined;
    }

    interface ValidNames extends Results {
        validForNewPackages: true;
        validForOldPackages: true;
    }

    interface InvalidNames extends Results {
        validForNewPackages: false;
        validForOldPackages: false;
        errors: string[];
    }

    interface LegacyNames extends Results {
        validForNewPackages: false;
        validForOldPackages: true;
        warnings: string[];
    }
}

declare function validate(name: string): validate.ValidNames | validate.InvalidNames | validate.LegacyNames;

export = validate;

````

### Additional Details
 * Last updated: Thu, 23 Jun 2022 08:01:38 GMT
 * Dependencies: none
 * Global values: none

# Credits
These definitions were written by [Florian Keller](https://github.com/ffflorian), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).