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

hast

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

hast - npm Package Compare versions

Comparing version 0.0.2 to 1.0.0

64

package.json
{
"name": "hast",
"version": "0.0.2",
"description": "HTML processor powered by plugins",
"version": "1.0.0",
"description": "Renamed to rehype",
"license": "MIT",
"keywords": [
"process",
"parse",
"transform",
"compile",
"stringify",
"html",
"abstract",
"syntax",
"tree",
"json",
"ast"
],
"dependencies": {
"bail": "^1.0.0",
"camelcase": "^1.2.1",
"ent": "^2.2.0",
"escape-html": "^1.0.3",
"htmlparser2": "^3.8.3",
"param-case": "^1.1.1",
"property-information": "^2.0.0",
"trim": "0.0.1",
"unified": "^2.1.0"
},
"keywords": [],
"repository": {
"type": "git",
"url": "https://github.com/wooorm/hast.git"
"url": "https://github.com/wooorm/rehype"
},
"author": "Titus Wormer <tituswormer@gmail.com>",
"files": [
"lib/",
"index.js"
"author": "Titus Wormer <tituswormer@gmail.com> (http://github.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (http://github.com)"
],
"devDependencies": {
"eslint": "^1.4.1",
"istanbul": "^0.3.21",
"jscs": "^2.1.1",
"jscs-jsdoc": "^1.2.0",
"mdast": "^2.0.0",
"mdast-comment-config": "^1.0.0",
"mdast-github": "^1.0.0",
"mdast-lint": "^1.1.1",
"mdast-slug": "^2.0.0",
"mdast-validate-links": "^1.1.1",
"tape": "^4.2.0",
"unist-util-visit": "^1.0.0"
},
"scripts": {
"build-md": "mdast . --quiet --frail",
"build": "npm run build-md",
"lint-api": "eslint .",
"lint-style": "jscs --reporter inline .",
"lint": "npm run lint-api && npm run lint-style",
"test-api": "node test.js",
"test-coverage": "istanbul cover test.js",
"test": "npm run build && npm run lint && npm run test-coverage"
}
"bugs": "https://github.com/wooorm/rehype/issues",
"dependencies": {}
}

@@ -1,116 +0,3 @@

# ![hast](https://cdn.rawgit.com/wooorm/hast/master/logo.svg)
# Renamed to rehype
**hast** is an HTML processor powered by plugins. Lots of bla. Bla and Bla.
100% coverbla.
> **hast is not (yet) fit for human consumption**.
Just like what [**retext**](https://github.com/wooorm/retext) did for natural
language and [**mdast**](https://github.com/wooorm/mdast) for markdown, now
comes HTML.
## Installation
[npm](https://docs.npmjs.com/cli/install):
```bash
npm install wooorm/hast
```
## API
### [hast](#api).process(value, done?)
Parse an HTML document, apply plugins to it, and compile it.
**Signatures**
* `doc = hast().process(value, options?, done?)`.
* `done` (`function(Error?, File?, string?)`) — Callback invoked when the
is generated with either an error, or a result. Only strictly needed when
async plugins are used.
**Returns**
`string` or `null`: A document. The result is `null` if a plugin is
asynchronous, in which case the callback `done` should’ve been passed (don’t
worry: plugin creators make sure you know it’s async).
### [hast](#api).use(plugin, options?)
Change the way [`hast`](#api) works by using a `plugin`.
**Signatures**
* `processor = hast.use(plugin, options?)`;
* `processor = hast.use(plugins)`.
**Parameters**
* `plugin` (`Function`) — A **Plugin**;
* `plugins` (`Array.<Function>`) — A list of **Plugin**s;
* `options` (`Object?`) — Passed to plugin. Specified by its documentation.
**Returns**
`Object`: an instance of HAST: The returned object functions just like
**hast**, but caches the `use`d plugins. This provides the ability to chain
`use` calls to use multiple plugins, but ensures the functioning of the
**hast** module does not change for other dependents.
## Nodes
**hast** exposes the processed document using [unist](https://github.com/wooorm/unist)
nodes and files (so there are already [tools](https://github.com/wooorm/unist#unist-node-utilties)
for working with the syntax tree).
```idl
interface Node {
type: string;
data: Data | null;
}
interface Data { }
interface Properties { }
interface Parent <: Node {
children: [];
}
interface Element <: Parent {
type: "element";
tagName: string;
properties: Properties;
children: [];
}
interface Root <: Parent {
type: "root";
}
interface Directive <: Node {
type: "directive";
value: string;
}
interface Comment <: Node {
type: "comment";
value: string;
}
interface CharacterData <: Node {
type: "characterData";
value: string;
}
interface Text <: Node {
type: "text";
value: string;
}
```
## License
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)
[rehype »](https://github.com/wooorm/rehype)
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