PHPackages                             sirmekus/nkem - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sirmekus/nkem

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sirmekus/nkem
=============

A package that replaces values in a JSON file to their \\"types\\" in either Typescript, JSON

1.3(9mo ago)08MITPHPPHP ^8.0

Since Jul 15Pushed 9mo agoCompare

[ Source](https://github.com/SirMekus/nkem)[ Packagist](https://packagist.org/packages/sirmekus/nkem)[ RSS](/packages/sirmekus-nkem/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

About Nkem
----------

[](#about-nkem)

This is a CLI package that replaces values in a JSON file to their types in either Typescript or JSON.

If you work on developing API, you'll agree that it's important to have a good understanding of the data that's being sent to and from the API/server. This package aims to make that process easier by generating valid "types" for your JSON response(s) via feeding it with a sample of an actual response (stored in a JSON file).

You can also, of course, use it to generate valid type interface for your TypeScript code.

> ##### By the way, "Nkem" is a word that means "my own" in Igbo language.😉
>
> [](#by-the-way-nkem-is-a-word-that-means-my-own-in-igbo-language)

Installation
------------

[](#installation)

To install the package, run:

```
composer require sirmekus/nkem
```

How To Use
----------

[](#how-to-use)

After installing the package, run it in your terminal like so:

```
./vendor/bin/type path/to/your.json
```

If you want its TypeScript representation, run it like so:

```
./vendor/bin/type path/to/your.json --format=ts
```

By default, the generated file will retain the name of the supplied JSON file with "-type" appended to it. You can change this behavior by using the `--name` flag. For example, if you want to name the generated file "custom-name.ts", you can run it like so (without the extension):

```
./vendor/bin/type path/to/your.json --format=ts --name=custom-name
```

Limitations
-----------

[](#limitations)

The types will be generated based on the values in the JSON file.

Also, if a key can contain a range of possible types (like "string|number"), the package may not be able to interpret it correctly. For example, if the JSON file contains a key whose value can either be a string or an number but the value in the JSON file is a string, its type will be generated as `string`.

To rectify this limitation, manual interaction may be required for the affected keys after generating the types.

Primarily, the package does the heavy lifting of generating the types for you.

Contributing
------------

[](#contributing)

Of course, there can always be room (and parlour 😁) for improvement. If you have any suggestions or ideas, please feel free to open an issue or submit a pull request.

License
-------

[](#license)

This package is licensed under the MIT License.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28a362d4564e674503260a2ed783e522418dcf6484eeb91616e4624c77a775f9?d=identicon)[sirmekus](/maintainers/sirmekus)

---

Top Contributors

[![SirMekus](https://avatars.githubusercontent.com/u/69574975?v=4)](https://github.com/SirMekus "SirMekus (8 commits)")

### Embed Badge

![Health badge](/badges/sirmekus-nkem/health.svg)

```
[![Health](https://phpackages.com/badges/sirmekus-nkem/health.svg)](https://phpackages.com/packages/sirmekus-nkem)
```

###  Alternatives

[cubear/finder

Finder is a Drupal 8 module to help users find services which meet their criteria

404.2k](/packages/cubear-finder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
