Socket
Socket
Sign inDemoInstall

is-dom

Package Overview
Dependencies
2
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-dom

Check if the given object is a dom node


Version published
Weekly downloads
1.7M
increased by3.96%
Maintainers
1
Install size
17.4 kB
Created
Weekly downloads
 

Package description

What is is-dom?

The is-dom npm package is a simple utility that allows developers to check if a given object is a DOM element. This can be particularly useful when working with the DOM in a web browser environment, ensuring that operations on elements are only attempted if the object in question is indeed a valid DOM element.

What are is-dom's main functionalities?

Check if an object is a DOM element

This feature allows developers to verify whether a given object is a DOM element. The code sample demonstrates how to use the is-dom package to check if 'document.body' is a DOM element.

var isDom = require('is-dom');

if (isDom(document.body)) {
  console.log('This is a DOM element.');
} else {
  console.log('This is not a DOM element.');
}

Other packages similar to is-dom

Readme

Source

is-dom

NPM version build status Test coverage Downloads

Check if the given object is a dom node.

Installation

$ npm install is-dom

Usage

var isDom = require('is-dom')

isDom(window.document)
// => true

License

MIT

Keywords

FAQs

Last updated on 21 Jun 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc