https://github.com/alessiofrittoli/type-utils
Lightweight TypeScript types utilities
https://github.com/alessiofrittoli/type-utils
typescript
Last synced: 2 months ago
JSON representation
Lightweight TypeScript types utilities
- Host: GitHub
- URL: https://github.com/alessiofrittoli/type-utils
- Owner: alessiofrittoli
- License: mit
- Created: 2024-11-24T16:48:54.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-03-21T11:52:49.000Z (3 months ago)
- Last Synced: 2025-04-15T05:47:40.585Z (2 months ago)
- Topics: typescript
- Language: TypeScript
- Homepage: https://npmjs.com/package/@alessiofrittoli/type-utils
- Size: 169 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: license.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Type Utils ❇️
[![NPM Latest Version][version-badge]][npm-url] [![Socket Status][socket-badge]][socket-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
[version-badge]: https://img.shields.io/npm/v/%40alessiofrittoli%2Ftype-utils
[npm-url]: https://npmjs.org/package/%40alessiofrittoli%2Ftype-utils
[socket-badge]: https://socket.dev/api/badge/npm/package/@alessiofrittoli/type-utils
[socket-url]: https://socket.dev/npm/package/@alessiofrittoli/type-utils/overview
[downloads-badge]: https://img.shields.io/npm/dm/%40alessiofrittoli%2Ftype-utils.svg
[deps-badge]: https://img.shields.io/librariesio/release/npm/%40alessiofrittoli%2Ftype-utils
[deps-url]: https://libraries.io/npm/%40alessiofrittoli%2Ftype-utils[sponsor-badge]: https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2
[sponsor-url]: https://github.com/sponsors/alessiofrittoli## Lightweight TypeScript types utilities
### Table of Contents
- [Getting started](#getting-started)
- [Utility types](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md)
- [ValueOf](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#valueof)
- [ValueOfKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#valueofkey)
- [OptionalKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#optionalkey)
- [Writeable](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#writeable)
- [RenameKey](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#renamekey)
- [ArgumentTypes](https://github.com/alessiofrittoli/type-utils/blob/master/docs/utils/README.md#argumenttypes)
- [Extenders types](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md)
- [JSON](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#json)
- [JSON.stringify\()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#jsonstringifyt)
- [JSON.parse\()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#jsonparset)
- [Body](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#body)
- [Body.json\()](https://github.com/alessiofrittoli/type-utils/blob/master/docs/extenders/README.md#bodyjsont)
- [Development](#development)
- [Install depenendencies](#install-depenendencies)
- [Build the source code](#build-the-source-code)
- [ESLint](#eslint)
- [Contributing](#contributing)
- [Security](#security)
- [Credits](#made-with-)---
### Getting started
Run the following command to start using `type-utils` in your projects:
```bash
npm i @alessiofrittoli/type-utils
```or using `pnpm`
```bash
pnpm i @alessiofrittoli/type-utils
```This tiny library defines some global types which are not imported in your IDE by default.\
After installation a `postinstall` script is executed to create the `alessiofrittoli-env.d.ts` file at the root of your project.
This script will try to update your `tsconfig.json` file.If that fail, please, make sure to add `alessiofrittoli-env.d.ts` in the array of the "include" property in your `tsconfig.json`.
```json
{
"compilerOptions": {
...
},
"include": [ ..., "alessiofrittoli-env.d.ts" ],
}
```You can skip this process if `*.ts` is already in your "include" array.
⚠️ If the `alessiofrittoli-env.d.ts` file creation fails you can run the following command to manually execute the script:
```bash
node node_modules/@alessiofrittoli/type-utils/scripts/postinstall/index.js
```---
### Development
#### Install depenendencies
```bash
npm install
```or using `pnpm`
```bash
pnpm i
```#### Build the source code
Run the following command to test and build code for distribution.
```bash
pnpm build
```#### [ESLint](https://www.npmjs.com/package/eslint)
warnings / errors check.
```bash
pnpm lint
```---
### Contributing
Contributions are truly welcome!
Please refer to the [Contributing Doc](./CONTRIBUTING.md) for more information on how to start contributing to this project.
Help keep this project up to date with [GitHub Sponsor][sponsor-url].
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
---
### Security
If you believe you have found a security vulnerability, we encourage you to **_responsibly disclose this and NOT open a public issue_**. We will investigate all legitimate reports. Email `[email protected]` to disclose any security vulnerabilities.
### Made with ☕
![]()
Alessio Frittoli
https://alessiofrittoli.it |
[email protected]