Gathering detailed insights and metrics for @fenge/types
Gathering detailed insights and metrics for @fenge/types
Gathering detailed insights and metrics for @fenge/types
Gathering detailed insights and metrics for @fenge/types
npm install @fenge/types
Typescript
Module System
Min. Node Version
Node Version
NPM Version
79.7
Supply Chain
91.2
Quality
90.4
Maintenance
100
Vulnerability
99.6
License
fenge@0.9.5
Updated on Jul 02, 2025
eslint-plugin-pkg-json@0.4.3
Updated on Jul 02, 2025
@fenge/eslint-config@0.7.5
Updated on Jul 02, 2025
smells@0.1.5
Updated on Jul 01, 2025
fenge@0.9.4
Updated on Jul 01, 2025
@fenge/eslint-config@0.7.4
Updated on Jul 01, 2025
TypeScript (75%)
JavaScript (25%)
Total Downloads
1,550
Last Day
2
Last Week
59
Last Month
95
Last Year
1,550
MIT License
41 Stars
1,291 Commits
4 Forks
1 Watchers
6 Branches
1 Contributors
Updated on Jul 02, 2025
Latest Version
0.4.2
Package Id
@fenge/types@0.4.2
Unpacked Size
2.39 MB
Size
327.35 kB
File Count
101
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jun 29, 2025
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
0%
59
Compared to previous week
Last Month
-43.8%
95
Compared to previous month
Last Year
0%
1,550
Compared to previous year
1
2
A type replacement for enhancing TypeScript built-in apis.
TypeScript supports replacing built-in definitions by installing a lib to node_modules
, since v4.5. TypeScript built-in definitions have a large number of any
, which are not type-safe enough.
This is a library that provides stricter type definitions for enhancing TypeScript built-in apis.
Here are all features and differences between the built-in definitions and this library.
Without this library:
JSON.parse
returns any
.Array.isArray
returns any[]
.new Map()
generates Map<any, any>
.new Promise()
can reject a non Error
variable.Promise.reject
accepts any
as a reason.Promise.prototype.catch
accepts (reason: any) => void | PromiseLike<void>
.Promise.prototype.then
accepts (reason: any) => void | PromiseLike<void>
for the second parameter.With this library:
JSON.parse
returns unknown
.Array.isArray
returns unknown[]
.new Map()
generates Map<unknown, unknown>
.new Promise()
must reject an Error
variable.Promise.reject
accepts Error
as a reason.Promise.prototype.catch
accepts (reason: unknown) => void | PromiseLike<void>
.Promise.prototype.then
accepts (reason: unknown) => void | PromiseLike<void>
for the second parameter.Firstly, if you have install @types/node
, make sure its version >= 18.0.0
.
Then, add this library to devDependencies
field in package.json
file. You can replace the version of 0.4.0
with the expected version.
1{ 2 "devDependencies": { 3 "@typescript/lib-es2020": "npm:@fenge/types@0.4.0" 4 } 5}
Finally, run npm install
or yarn install
or pnpm install
.
After that, writing TypeScript code will be more type-safe. Example:
1const foo = JSON.parse('{"bar": 1}'); // The `foo` is `unknown` type now. 2console.log(foo.baz + 1); // error: 'foo' is of type 'unknown'.
MIT
No vulnerabilities found.
No security vulnerabilities found.