npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tsriot

v0.0.4

Published

Riot.js with TypeScript.

Readme

tsriot

It is a small extension for writing Riot.js script with TypeScript.

Tag layout (HTML with style) and logic can be written as separate files. This makes it easier for IDE to assist source code development. It is effective when you want to attract the benefits of TypeScript's type system, such as when developing with multiple people.

How to use

Install

npm install --save-dev tsriot

Write a tag

In tsriot, Riot.js tag consists of two files: .html and .ts.

  • In .html file, you write only layout (HTML with style) of a tag.
  • In .ts file, you write only logic (script) of a tag using TypeScript.

These file names except the extension must be the same. You can omit .ts file when the tag has no logic.

Example

hello-world.html

<hello-world>
  <div><input onkeyup={ edit } placeholder="Enter your name"></div>
  <p>Hello, { name }.</p>
  <style>
    ... (omitted)
  </style>
</hello-world>

hello-world.ts

import * as tsriot from 'tsriot';

class HelloWorldTag extends tsriot.Tag {
  name: string;

  init() {
    this.name = 'world';
  }

  edit(e: tsriot.DomEvent) {
    this.name = (<HTMLInputElement>event.target).value;
  }
}

You write a class corresponding to a tag.

  • A name of tag class must be CamelCase of a tag name + Tag.
  • A tag class should be extended from the tsriot.Tag class.
  • A tag class has same properties and methods of Riot tag instance. See http://riotjs.com/api/ for details.
  • You can write initialization logic of a tag in init() method.
  • When implementing a constructor, you must implement a constructor without arguments.
    • In a constructor, you cannot access standard properties of a tag such as opts. So you should use init() method for tag initialization.

After writing .html and .ts files, compile these files by tsriot command.

tsriot hello-world.html > hello-wold-tag.ts

tsriot command outputs TypeScript source code like original riot command do so.

For more examples, see tsriot examples.

Restrictions

Currently, only the following custom parsers are supported.

  • HTML: none
  • CSS: less

Build from source

npm install
npm run build

Acknowledgement

This software uses source code from the following software.

Riot.js

MIT: https://github.com/riot/riot

Copyright (c) 2015-present
Originally created by Muut Inc.
Actively maintained by:
 - Richard Bondi https://github.com/rsbondi
 - Gianluca Guarini https://github.com/GianlucaGuarini
 - Tsutomu Kawamura https://github.com/cognitom
 - Alberto Martínez https://github.com/aMarCruz
 - Grant Marvin https://github.com/rogueg
 - Tero Piirainen https://github.com/tipiirai

riot-compiler

MIT: https://github.com/riot/compiler

Copyright (c) 2015 Riot

@types/riot

MIT: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/riot

Definitions by: Boriss Nazarovs <https://github.com/Stubb0rn>

riot-typed

MIT: https://github.com/Joylei/riot-typed

Copyright (c) 2017 Joylei<[email protected]>

License

MIT. See LICENSE file for details.