New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

targetenv

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

targetenv

What's the build target?

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

targetenv.js

This module is for doing things conditionally based on the environment you're targeting. It uses the build tool itself (browserify, webpack) instead of relying on examining the environment (for example, module.exports, etc).

Usage

var targetEnv = require('targetenv');
if (targetEnv.isBrowser) {
  // Do something.
}

Properties

target Either "main", "browser", "web", or "webpack", depending on which file was used as the main module.
isBrowserA boolean that indicates whether this code built for the browser.

How

The module's package.json tells your build tool (browserify, webpack) to use a different entry point (which can be examined).

Keywords

environment

FAQs

Package last updated on 24 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts