# @mojule/html

> Information about the node types used in HTML

Latest version **0.2.4** (published 2017-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mojule/html
pnpm add @mojule/html
yarn add @mojule/html
bun add @mojule/html
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2017-04-18 |
| First published | 2017-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nik Coughlin |
| Maintainers | andybell, nrkn |
| Keywords | html, metadata, info |

## Links

- npm: https://www.npmjs.com/package/@mojule/html
- Repository: https://github.com/mojule/html
- Homepage: https://github.com/mojule/html#readme
- Issues: https://github.com/mojule/html/issues
- npm.io page: https://npm.io/package/@mojule/html

## Dependencies (1)

- [@mojule/is](https://npm.io/package/@mojule/is.md) ^0.1.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.2.4 (latest) — 2017-04-18
- 0.2.3 — 2017-04-11
- 0.2.2 — 2017-04-11
- 0.2.1 — 2017-04-11
- 0.2.0 — 2017-04-11
- 0.1.0 — 2017-04-11

## README

# html

Information about the node types used in HTML - what categories do elements or
nodes belong to, can you put a given node inside another node etc.

Mostly for elements but functions can also take a nodeName eg. #text

## Install

`npm install @mojule/html`

## Example

```javascript
const info = require( '@mojule/html' )

// tagNames() => [string]
console.log( info.tagNames() )

// categoryNames() => [string]
console.log( info.categoryNames() )

// isEmpty( nodeName: string ) => boolean
console.log( info.isEmpty( 'img' ) ) // true
console.log( info.isEmpty( 'div' ) ) // false

// isMetadata( nodeName: string ) => boolean
console.log( info.isMetadata( 'head' ) ) // true
console.log( info.isMetadata( 'div' ) ) // false

// isInline( nodeName: string ) => boolean
console.log( info.isInline( 'span' ) ) // true
console.log( info.isInline( '#text' ) ) // true
console.log( info.isInline( 'div' ) ) // false

// isEmbedded( nodeName: string ) => boolean
console.log( info.isEmbedded( 'img' ) ) // true
console.log( info.isEmbedded( 'div' ) ) // false

// isBlock( nodeName: string ) => boolean
console.log( info.isBlock( 'div' ) )  // true
console.log( info.isBlock( 'span' ) ) // false

// isContainer( nodeName: string )
console.log( info.isContainer( 'div' ) ) // true
console.log( info.isContainer( 'img' ) ) // false

// accepts( parentNodeName: string, childNodeName: string )
console.log( info.accepts( 'div', 'span' ) ) // true
console.log( info.accepts( 'span', 'div' ) ) // false

// def( nodeName ) => object
console.log( info.def( 'div' ) )
```

---
_Source: https://npm.io/package/@mojule/html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
