Skip to content

peterczg/is-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-nodejs

Check if your current js-runtime is node.js.

Installation

yarn add is-nodejs
# or
npm install is-nodejs --save

Usage

CommonJS

const isNodejs = require('is-nodejs')

ES Module

import isNodejs from 'is-nodejs'

Implementation

function isNodejs () {
    return typeof process !== 'undefined' && !!process.versions && !!process.versions.node
}

About

Check if current js-runtime is node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published