browser-process-platform

2019-08-16 admin

browser-process-platform是什么

什么是browser-process-platform,Browser shim for Node.js process.platform

browser-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.platform independent of the environment.

I’d like to thank @kumavis for 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 Conduct and follows the IPFS guidelines for JavaScript projects.

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

License

MIT © 2018 Protocol Labs, Inc.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-72641.html

文章标题:browser-process-platform

回到顶部