0.0.7 • Published 5 months ago

@daxplrer/isnode v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

detect node engines and js enviroments directly from your scripts. Tested on modern browser, nodejs, and deno

Install

npm install @daxplrer/isnode
# or
npm install --save @daxplrer/isnode

how about deno?

Updates

  • bugs fixed

Examples

detect if the node engine was v8

import isnode from '@daxplrer/isnode'
// you can use require too
// const isnode = require('@daxplrer/isnode')

function isusingv8() {
// check using the engine() function
if (isnode.engine()==='v8') return true
else return false;

}

// send the output to the console
console.log(isusingv8())

detect if the js enviroment is in jxcore

import isnode from '@daxplrer/isnode'
if (isnode.env()==='jx'){ 
  console.log('you are in jxcore')
} else {
  throw new Error('you are in '+isnode.env())
}

Source code

github repo

Note

for deno

welp, use this

import {isnode as detectNode} from 'npm:@daxplrer/isnode@0.0.5'
0.0.7

5 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago