Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 22, 2024 via pnpm
Package summary
Share
0
issues
1
license
4
MIT
Package created
1 Aug 2015
Version published
7 Jul 2023
Maintainers
2
Total deps
4
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
@types/unist@3.0.2
unist-util-is@6.0.0
unist-util-visit-parents@6.0.1
unist-util-visit@5.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of unist-util-visit 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@types/unist3.0.22.55 kBMIT
prod
unist-util-is6.0.06.76 kBMIT
prod
unist-util-visit-parents6.0.18.95 kBMIT
prod

Visualizations

Frequently Asked Questions

What does unist-util-visit do?

Unist-util-visit is a highly effective utility for working with unist. It's main functionality involves the walking of trees and exploration of nodes within a unist tree. This proves useful when you want to traverse the tree and inspect or manipulate nodes, particularly when handling markdown or other hierarchical data structures.

How do you use unist-util-visit?

To use unist-util-visit, first install the package using npm with npm install unist-util-visit. After installing, import it into your JavaScript file with import {visit} from 'unist-util-visit'. Then use the visit function, providing a tree, a test, and a visitor function like so:

import {fromMarkdown} from 'mdast-util-from-markdown'
import {visit} from 'unist-util-visit'

const tree = fromMarkdown('Some *emphasis*, **strong**, and `code`.')

visit(tree, 'text', function (node, index, parent) {
  console.log([node.value, parent ? parent.type : index])
})

In this example, the markdown text is converted to a unist tree, then the visit function traverses the tree and logs each 'text' node's value along with either the type of its parent node or its index.

Where are the unist-util-visit docs?

The documentation for unist-util-visit can be found in the README file on its GitHub repository, available at git+https://github.com/syntax-tree/unist-util-visit.git. The README includes a detailed explanation of the utility's functionality, how to use it, and the various API methods it provides. It also includes TypeScript typings and related resources.