JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 217
  • Score
    100M100P100Q50582F
  • License MIT

Tiny JS Type Checker Module for Node & Browser — Supports Stringified Types

Package Exports

  • @echo-64/is.js

Readme

is.js

This module provides utility functions for checking the type of a given value in JavaScript, It offers functionality beyond basic typeof checks by supporting "stringified types", which likely means it can handle type checks based on string representations of types or more complex type definitions.

Features

  • Cross-platform: Working in both Node.js environments and web browsers.

  • Type-predicates: It leverages TypeScript's type predicate feature to provide strong type checking for JavaScript data.

Installation

NodeJs

npm install @echo-64/is.js

Browser

In your HTML file, add a <script> tag within the <head> section, linking to the local file:

<head>
  <script src="dist/is.min.js"></script>
</head>

Usage

// commonjs
const is = require("@echo-64/is.js");

// esm
import is from "@echo-64/is.js";

// browser
<script src="is.min.js"></script>

See: docs

CHANGELOG

CHANGELOG.md

License

MIT License ©