browser-process-platform

2019-08-16

Browser shim for Node.js process.platform

browser-process-platform

Browser shim for Node.js process.platform.

See documentation at nodejs.org.

Background

When running tests in Node.js as well as in the Browser, you might want to skip tests depending on the platform. With this shim it is possible to use process.platformindependent of the environment.

I’d like to thank @kumavisfor his browser-process-hrtime module, it was a great inspiration to create this module.

Install

> npm install browser-process-platform

Usage

Via monkey-patching

process.platform = require('browser-process-platform')
console.log('The current platform is:', process.platform)

As module

const platform = require('browser-process-platform')
console.log('The current platform is:', platform)

Maintainers

@vmx

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conductand follows the IPFS guidelines for JavaScript projects.

Small note: If editing the README, please conform to the standard-readmespecification.

License

MIT© 2018 Protocol Labs, Inc.

HomePage

https://github.com/ipfs/browser-process-platform#readme

Repository

https+https://github.com/ipfs/browser-process-platform


上一篇:iso-stream-http
下一篇:angular(angular6/angular7/angular8) delete请求没有body体的问题
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部