Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

platform-detect

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

platform-detect

🃏 Minimalistic isomorphic library for detection of platform, runtime, APIs and more.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9K
increased by135.77%
Maintainers
1
Weekly downloads
 
Created
Source

platform-detect

NPM Dependency Status devDependency Status Maintenance Status Known Vulnerabilities Discord Gitter Maintainability

🃏 Minimalistic isomorphic library for detection of platform, runtime, APIs and more.

Detects Browsers, Node, Electron, NW.JS, PWA, UWP, Web workers and child processes.

Installation

npm install platform-detect

Usage

import platform from 'platform-detect'


// The script has no window or GUI to render content to.
// It only runs in console / terminal. (Might be a Node script or WebWorker)
platform.console
// App has a window, access to DOM. Can render GUI.
platform.window

// Fully functional Node & core modules are available. (Might be an Electron / NWJ.JS app or a Node console script)
platform.node
// App has been loaded as a plain website in a browser.
platform.web
// Script is executed inside Web Worker.
platform.worker

// App has been loaded as a PWA / UWP / Electron / NW.JS / Cordova app
platform.pwa
platform.uwp
platform.electron
platform.nwjs
platform.cordova

FAQs

Package last updated on 29 Sep 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc