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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@riot-tools/tori

v2.0.0

Published

Tori - Opinionated Riot component generator

Downloads

6

Readme

tori - Opinionated Riot component generator

tori CLI tool, inspired by hpal

!!! BREAKING CHANGE WITH V2 !!!

With version 2, the package was moved to a different organization (@graundsco -> @riot-tools). Please check the updated installation instruction below to use the latest version. There are no other new changes to the functionalities whatsoever.

Installation and usage

Note: tori was developed with nodejs v12+, it hasn't been tested in earlier versions

Recommended way:

npm i @riot-tools/tori -D
npx tori path/to/component

How it works

By default tori will take in the whole path structure where you want to create the component. It will use the last part of the path as the name of the component.

Running npx tori src/components/my-component will generate my-component directory under src/components/ with all the files defined in the templates. Note that you don't have to create the parent directories as tori will recursively create them for you if they don't exist.

Tori assumes that alongside using riot, you will use Jest as the testing framework.

Some of the code has been commented out in the template files to make it more convenient for you to enable them.

Customization

You can extend tori's component generation by defining paths to your desired directories in package.json.

package.json example

"tori": {
  "basePath": "src",             // The root of your source code. Note that the key MUST BE "basePath"
  "components": "components"     // Key defines the command you can use with tori and the value is the path based on "basePath" value
  "common": "components/common" 
},

Now, if you want to create a component under src/components/common, you can run npx tori common my-component.

Note: the keys don't have to match the directory names: they can be anything! Just remember that they will be the commands you will use with tori, e.g. key named x will become npx tori x component-name.

Dependencies

TODO

  • [ ] Support defining your own templates in your work directory
  • [ ] More command line options for the tool?
    • e.g. help
  • Something else? Let us know!