
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
utf-railroad
Advanced tools
Draw railroad diagrams using UTF-8 characters.
import {
draw,
diagram,
sequence,
terminal,
nonTerminal,
} from "../utf-railroad";
console.log(
draw(diagram(sequence([terminal("hello"), nonTerminal("world")]), true))
);
output:
╭───────╮ ┏━━━━━━━┓
╟─┤ hello ├─┨ world ┠─╢
╰───────╯ ┗━━━━━━━┛
Shapes supported:
diagram(element: DiagramElement, complex: boolean = false): DiagramElementterminal(content: string): DiagramElementnonTerminal(content: string): DiagramElementspecial(content: string): DiagramElementsequence(elements: DiagramElement[]): DiagramElementstack(elements: DiagramElement[]): DiagramElementchoice(elements: DiagramElement[], defaultOption: number = 0): DiagramElementhorizontalChoice(elements: DiagramElement[]): DiagramElementoptional(element: DiagramElement): DiagramElementrepeater(element: DiagramElement, inBetween?: DiagramElement): DiagramElementgroup(element: DiagramElement, label?: string): DiagramElementcomment(comment: string): DiagramElementcommentWithLine(comment: string): DiagramElementJSON Array:
╭───╮ ┏━━━━━━━┓ ┏━━━━━━━┓ ╭───╮
╟─┤ [ ├─┨ value ┠─┬┨ value ┠┬─┤ ] ├─╢
╰───╯ ┗━━━━━━━┛ │┗━━━━━━━┛│ ╰───╯
│ ╭───╮ │
╰─┤ , ├─←─╯
╰───╯
JSON String:
╭───────────────────────────────→────────────────────────────────╮
╭───╮ │ ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮ │ ╭───╮
┠─┤ " ├─┴┬┬┤ Any unicode character except " or \ or control character ├┬┬┴─┤ " ├─┨
╰───╯ ││╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯││ ╰───╯
││ ╭───╮ ╭───╮ quotation mark ││
│╰──────────┤ \ ├─┬────┤ " ├──────────────────────┬───────────╯│
│ ╰───╯ │ ╰───╯ │ │
│ │ ╭───╮ reverse solidus │ │
│ ├────┤ \ ├──────────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ solidus │ │
│ ├────────┤ / ├──────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ backspace │ │
│ ├───────┤ b ├───────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ formfeed │ │
│ ├───────┤ f ├───────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ newline │ │
│ ├────────┤ n ├──────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ carriage return │ │
│ ├────┤ r ├──────────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ horizontal tab │ │
│ ├────┤ t ├──────────────────────┤ │
│ │ ╰───╯ │ │
│ │ ╭───╮ ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮ │ │
│ ╰─┤ u ├─┬┤ hexadecimal digit ├┬─╯ │
│ ╰───╯ │╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯│ │
│ ╰───────╴4 x╶─←───────╯ │
╰───────────────────────────────←──────────────────────────────╯
The code is licensed under MIT (see LICENSE file).
Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here
FAQs
utf railroad diagrams
We found that utf-railroad demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.