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

orgast-util-visit-ids

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orgast-util-visit-ids

orgast (uniorg) utility to visit all nodes with ids

  • 0.5.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66
decreased by-32.65%
Maintainers
2
Weekly downloads
 
Created
Source

orgast-util-visit-ids

orgast (uniorg) utility to visit all nodes with ids.

Install

npm install orgast-util-visit-ids

Use

import { unified } from 'unified';
import uniorgParse from 'uniorg-parse';
import { visitIds } from 'orgast-util-visit-ids';

const tree = unified().use(uniorgParse).parse(`
:PROPERTIES:
:ID: id-org-data
:END:

* First headline
:PROPERTIES:
:ID: id-headline
:END:
** Second headline
:PROPERTIES:
:ID: id-headline-2
:END:
`);

visitIds(tree, (id, node) => {
  console.log(id, node.type, node.rawValue);
});
//=> id-org-data org-data undefined
//=> id-headline headline First headline
//=> id-headline-2 headline Second headline

API

visitIds(node: OrgData, callback: (id: string, node: OrgData | Headline) => void)

Call callback for every node that has an id assigned.

License

GNU General Public License v3.0 or later

Keywords

FAQs

Package last updated on 01 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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