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

globals-docs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globals-docs - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

.travis.yml

12

globals-docs.json

@@ -449,5 +449,5 @@ {

"worker": {
"importScripts": true,
"postMessage": true,
"self": true
"importScripts": "https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts",
"postMessage": "https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/postMessage",
"self": "https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/self"
},

@@ -459,3 +459,3 @@ "node": {

"Buffer": "https://nodejs.org/api/buffer.html",
"clearImmediate": false,
"clearImmediate": "https://nodejs.org/api/timers.html#timers_clearimmediate_immediateobject",
"clearInterval": "https://nodejs.org/api/globals.html#globals_clearinterval_t",

@@ -470,4 +470,4 @@ "clearTimeout": "https://nodejs.org/api/globals.html#globals_cleartimeout_t",

"process": "https://nodejs.org/api/process.html",
"require": false,
"setImmediate": false,
"require": "https://nodejs.org/api/globals.html#globals_require",
"setImmediate": "https://nodejs.org/api/timers.html#timers_setimmediate_callback_arg",
"setInterval": "https://nodejs.org/api/globals.html#globals_setinterval_cb_ms",

@@ -474,0 +474,0 @@ "setTimeout": "https://nodejs.org/api/globals.html#globals_settimeout_cb_ms"

@@ -1,1 +0,32 @@

module.exports = require('./globals-docs.json');
var docs = require('./globals-docs.json');
/**
* Docs: an object of documentation as a plain-old-javascript object.
*
* Has keys that correspond to environments:
*
* - builtin
* - nonstandard
* - browser
* - worker
* - node
*/
module.exports.docs = docs;
/**
* Get a URL for a global object.
*
* @param {string} name name of the global object
* @param {Array<string>} env environments that will be reached. By default tries all environments
* @returns {string|undefined} the URL of the documentation resource, if found
* @example
* getDoc('Array'); // yields MDC documentation for Array
*/
module.exports.getDoc = function(name, env) {
if (!env) env = Object.keys(docs);
for (var i = 0; i < env.length; i++) {
var d = docs[env[i]][name];
if (d) return d;
}
};
{
"name": "globals-docs",
"version": "1.0.2",
"version": "2.0.0",
"description": "documentation links for all node and browser globals",

@@ -5,0 +5,0 @@ "main": "index.js",

# globals-docs
[![build status](https://secure.travis-ci.org/documentationjs/globals-docs.png)](http://travis-ci.org/documentationjs/globals-docs)
Documentation URIs for JavaScript globals.
## `docs`
Docs: an object of documentation as a plain-old-javascript object.
Has keys that correspond to environments:
- builtin
- nonstandard
- browser
- worker
- node
## `getDoc`
Get a URL for a global object.
### Parameters
| name | type | description |
| ---- | ---- | ----------- |
| `name` | `string` | name of the global object |
| `env` | `Array<string>` | environments that will be reached. By default tries all environments |
### Examples
```js
getDoc('Array'); // yields MDC documentation for Array
```
Returns the URL of the documentation resource, if found
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