All Projects → syntax-tree → Unist Util Visit

syntax-tree / Unist Util Visit

Licence: mit
utility to visit nodes

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Unist Util Visit

hast-util-to-html
utility to serialize hast to HTML
Stars: ✭ 47 (-53.47%)
Mutual labels:  syntax-tree, util
nlcst-to-string
utility to transform an nlcst tree to a string
Stars: ✭ 16 (-84.16%)
Mutual labels:  syntax-tree, util
hast-util-from-dom
utility to transform a DOM tree to hast
Stars: ✭ 20 (-80.2%)
Mutual labels:  syntax-tree, util
unist-util-map
utility to create a new tree by mapping all nodes
Stars: ✭ 30 (-70.3%)
Mutual labels:  syntax-tree, util
hast-util-sanitize
utility to sanitize hast nodes
Stars: ✭ 34 (-66.34%)
Mutual labels:  syntax-tree, util
unist-builder
utility to create a new trees with a nice syntax
Stars: ✭ 52 (-48.51%)
Mutual labels:  syntax-tree, util
mdast-util-to-string
utility to get the plain text content of an mdast node
Stars: ✭ 27 (-73.27%)
Mutual labels:  syntax-tree, util
unist-util-inspect
utility to inspect nodes
Stars: ✭ 16 (-84.16%)
Mutual labels:  syntax-tree, util
unist-util-visit-parents
utility to recursively walk over unist nodes, with ancestral information
Stars: ✭ 25 (-75.25%)
Mutual labels:  syntax-tree, util
Calyx
A Ruby library for generating text with recursive template grammars.
Stars: ✭ 51 (-49.5%)
Mutual labels:  syntax-tree
Schematics Utilities
🛠️ Useful exported utilities for working with Schematics
Stars: ✭ 73 (-27.72%)
Mutual labels:  util
Fssqldom
Library for SQL parsing, AST manipulation and SQL generation in F#
Stars: ✭ 45 (-55.45%)
Mutual labels:  syntax-tree
Goutil
go util 是golang通用工具包,实现一站式,开箱即用
Stars: ✭ 56 (-44.55%)
Mutual labels:  util
Easysp
A SharedPreferences wrapper that has a fluent interface to store data
Stars: ✭ 75 (-25.74%)
Mutual labels:  util
V Androidcollectsources
🔥💪 Github优秀开源项目整理,方便查阅,仅供参考,感谢开源!!!
Stars: ✭ 51 (-49.5%)
Mutual labels:  util
Greatwall
Util应用框架配套的权限管理系统
Stars: ✭ 88 (-12.87%)
Mutual labels:  util
Easyandroid
一个完整基于kotlin的安卓开发框架,采用了mvvm设计模式。涵盖了: 1、基于retrofit2封装的通过kotlin协程实现的网络框架 2、基于阿里开源router修改的api-router实现项目模块化 3、基于glide的图片加载缓存框架 4、基于room实现的往来数据缓存加载 5、基于step实现的数据异步提交 6、基于PreferenceHolder实现的本地数据快速存储 7、基于mlist实现的简单复杂列表的快速开发扩展 8、定制的toolbar可以自适应异形屏,挖孔屏,水滴屏等等。。 本框架几乎涵盖了开发所需的所有模块组件。简单fork之后就可以基于框架快速开发。
Stars: ✭ 33 (-67.33%)
Mutual labels:  util
Dialogutil
common used dialog with material style ( in support v7),ios style,get top activity automatically, invoke everywhere (any thread , any window)
Stars: ✭ 948 (+838.61%)
Mutual labels:  util
Fall
Stars: ✭ 92 (-8.91%)
Mutual labels:  syntax-tree
Syntax Highlighter
Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.
Stars: ✭ 88 (-12.87%)
Mutual labels:  syntax-tree

unist-util-visit

Build Coverage Downloads Size Sponsors Backers Chat

unist utility to visit nodes.

Install

npm:

npm install unist-util-visit

Use

var u = require('unist-builder')
var visit = require('unist-util-visit')

var tree = u('tree', [
  u('leaf', '1'),
  u('node', [u('leaf', '2')]),
  u('void'),
  u('leaf', '3')
])

visit(tree, 'leaf', function(node) {
  console.log(node)
})

Yields:

{ type: 'leaf', value: '1' }
{ type: 'leaf', value: '2' }
{ type: 'leaf', value: '3' }

API

visit(tree[, test], visitor[, reverse])

This function works exactly the same as unist-util-visit-parents, but visitor has a different signature.

next? = visitor(node, index, parent)

Instead of being passed an array of ancestors, visitor is invoked with the node’s index and its parent. The optional return value next is documented in unist-util-visit-parents’s README.

Otherwise the same as unist-util-visit-parents.

Related

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].