Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jeetiss/is-this-module


https://github.com/jeetiss/is-this-module

Last synced: 12 days ago
JSON representation

Awesome Lists containing this project

README

        

# is this module

pigeon with coffee

Tiny module type checker

* **useless** ðŸĪŠ
* supports **es** and **commonjs** modules
* works in **node** and **browser**

## usage

```js
// node v14
import { isEsm, isCjs } from 'is-this-module'

console.log(isEsm) // true
console.log(isCjs) // false
```

```js
// node v12
const { isEsm, isCjs } = require('is-this-module')

console.log(isEsm) // false
console.log(isCjs) // true
```

## install

```
npm i is-this-module
```

## example

[sandbox](https://codesandbox.io/s/is-this-module-example-603ff)