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

asciicast-to-svg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asciicast-to-svg

Render frames of Asciicasts as SVGs.

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

asciicast-to-svg

Render frames of Asciicasts as SVGs.

npm version build status ISC-licensed chat on gitter support me on Patreon

Installing

npm install -g asciicast-to-svg

Usage

CLI

Usage:
    asciicast-to-svg [time]

Arguments:
    time   Which frame to render, in seconds.

Examples:
    cat some-asciicast.json | asciicast-to-svg 2.3 > some-asciicast.svg

JavaScript API

To render an Asciicast at a specific time, use renderAt:

const renderAt = require('asciicast-to-svg')
const toString = require('virtual-dom-stringify')

const asciicast = { /* … */ }

console.log(toString(renderAt(asciicast, 2.3))) // at 2.3 seconds

You can also render individual frames by using createRenderer. This example will render all frames:

const {createRenderer} = require('asciicast-to-svg')

const renderer = createRenderer({width: asciicast.width, height: asciicast.height})
for (let [delay, data] of asciicast.stdout) {
	renderer.write(data)
	console.log(toString(renderer.render()))
}

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

Keywords

FAQs

Package last updated on 14 Aug 2018

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