Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/loatheb/is-native-modules

:ghost: :sparkles: Checking the JS module is native or not.Using the `process.binding` to connect with c++
https://github.com/loatheb/is-native-modules

module native native-module

Last synced: 3 months ago
JSON representation

:ghost: :sparkles: Checking the JS module is native or not.Using the `process.binding` to connect with c++

Awesome Lists containing this project

README

        

# Is-Native-Modules
[![Build Status](https://travis-ci.org/loatheb/is-native-modules.svg?branch=master)](https://travis-ci.org/loatheb/is-native-modules) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badge/)
> check the module is native module or not

### import

```shell
npm i --save is-native-modules
```

* CommonJS

```js
const isNativeModules = require('is-native-modules')
```

* ES6 module

```js
import isNativeModules from 'is-native-modules'
```

### usage

```js
isNativeModules('path') // true

isNativeModules('other_module') // false

isNativeModules(['path', 'fs']) // [true, true]

isNativeModules(['other_module', 'some_module']) // [false, false]

isNativeModules([['path', 'fs'], ['other_module', 'some_module']]) // [[true, true], [false, false]]

```