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

has-dom

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-dom - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

11

index.js

@@ -1,6 +0,5 @@

'use strict';
module.exports = function () {
return typeof window !== 'undefined'
&& typeof document !== 'undefined'
&& typeof document.createElement === 'function';
};
export default function hasDom() {
return typeof window !== 'undefined' &&
typeof document !== 'undefined' &&
typeof document.createElement === 'function';
}
{
"name": "has-dom",
"version": "1.0.1",
"description": "Check if a JavaScript environment has a DOM",
"license": "MIT",
"repository": "sindresorhus/has-dom",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "ava"
},
"files": [
"index.js"
],
"keywords": [
"browsers",
"dom",
"js",
"javascript",
"env",
"environment",
"has",
"detect",
"check"
],
"devDependencies": {
"ava": "*"
}
"name": "has-dom",
"version": "2.0.0",
"description": "Check if a JavaScript environment has a DOM",
"license": "MIT",
"repository": "sindresorhus/has-dom",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"browsers",
"dom",
"js",
"javascript",
"env",
"environment",
"has",
"detect",
"check"
],
"devDependencies": {
"ava": "^3.15.0",
"xo": "^0.39.1"
},
"xo": {
"envs": [
"node",
"browser"
]
}
}

@@ -1,17 +0,15 @@

# has-dom [![Build Status](https://travis-ci.org/sindresorhus/has-dom.svg?branch=master)](https://travis-ci.org/sindresorhus/has-dom)
# has-dom
> Check if a JavaScript environment has a [DOM](http://en.wikipedia.org/wiki/Document_Object_Model)
> Check if a JavaScript environment has a [DOM](https://en.wikipedia.org/wiki/Document_Object_Model)
## Install
```
$ npm install --save has-dom
$ npm install has-dom
```
## Usage
```js
var hasDom = require('has-dom');
import hasDom from 'has-dom';

@@ -26,6 +24,1 @@ // In Node.js

```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

Sorry, the diff of this file is not supported yet

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