Socket
Socket
Sign inDemoInstall

load-asciicast

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-asciicast


Version published
Maintainers
1
Install size
1.28 MB
Created

Readme

Source

asciinema.player.asciicast as npm module

load-asciicast

  • Normalize asciicast formats v0, v1, v2
  • Initialize frames into a asciinema Screen
  • Uses the same abstractions as asciinema-player

Install

npm install load-asciicast

Usage

import fs from 'fs';
import {promisify} from 'util';
import {load} from 'load-asciicast';

const read = promisify(fs.readFile);

(async () => {
  const data = String(await read('asciicast.json'));

  // Optional;
  // if width, height, and idle are not specified, they will be taken from data
  const options = {
    width: 80,  // Screencast width
    height: 25, // Screencast height
    idle: 2.5,  // Idle time limit in seconds
    fps: 30     // Frames per second limit, see https://github.com/marionebl/svg-term/issues/13
  };

  const asciicast = await load(data, options);
  // => {...}
})();

Development

Prerequisites

  • Java 8
  • Node 8
  • leiningen
git clone https://github.com/marionebl/load-asciicast.git
cd load-asciicast
git submodule update --init --recursive # init asciinema-player, vt
lein cljsbuild auto

# Other terminal window
npm install
npm start

Keywords

FAQs

Last updated on 12 Dec 2019

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc