https://github.com/stevenvachon/is-dom-detached
Determine if a Node does not exist within a DOM tree.
https://github.com/stevenvachon/is-dom-detached
dom element node orphan stray
Last synced: 2 months ago
JSON representation
Determine if a Node does not exist within a DOM tree.
- Host: GitHub
- URL: https://github.com/stevenvachon/is-dom-detached
- Owner: stevenvachon
- License: mit
- Created: 2019-06-17T16:29:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T09:07:23.000Z (about 6 years ago)
- Last Synced: 2024-10-06T04:24:02.321Z (over 1 year ago)
- Topics: dom, element, node, orphan, stray
- Language: JavaScript
- Homepage:
- Size: 196 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-dom-detached [![NPM Version][npm-image]][npm-url] ![File Size][filesize-image] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]
> Determine if a [`Node`](https://mdn.io/Node) does *not* exist within a DOM tree.
## Installation
[Node.js](http://nodejs.org) `>= 10` is required. To install, type this at the command line:
```shell
npm install is-dom-detached
```
## Importing
ES Module:
```js
import isDetachedNode from 'is-dom-detached';
```
CommonJS Module:
```js
const isDetachedNode = require('is-dom-detached');
```
## Usage
```js
const div = document.createElement('div');
isDetachedNode(div); //-> true
document.body.appendChild(div);
isDetachedNode(div); //-> false
````
[npm-image]: https://img.shields.io/npm/v/is-dom-detached.svg
[npm-url]: https://npmjs.com/package/is-dom-detached
[filesize-image]: https://img.shields.io/badge/size-490B%20gzipped-blue.svg
[travis-image]: https://img.shields.io/travis/stevenvachon/is-dom-detached.svg
[travis-url]: https://travis-ci.org/stevenvachon/is-dom-detached
[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/is-dom-detached.svg
[coveralls-url]: https://coveralls.io/github/stevenvachon/is-dom-detached
[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/is-dom-detached.svg
[greenkeeper-url]: https://greenkeeper.io/