Skip to content

Giancarl021/type-inference

Repository files navigation

type-inference

Infer JavaScript primtive types from a string value

Why?

A separate package for simple primitive type inference allows the re-use of the code for more complex applications.

Usage

Important: From version 1.0, this package supports only NodeJS with version 20 or later, and uses ES Modules exclusively.

This package can be downloaded from NPM.

The package exports a single function:

import inferType from '@giancarl021/type-inference';

const myInferedNumber = inferType('10');

console.log(typeof myInferedNumber === 'number');
// true

About

Infer JavaScript types from a string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published