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

mithril_component_tools

v1.0.13

Published

One-step mithril component utilities andtesting

Downloads

7

Readme

Mithril Component Tools

Install via npm install -g mithril_component_tools

To use any mithril_component_tools your mithril component you need to have these files in your repo:

  • COMPONENT_NAME.js: COMPONENT_NAME is the name of your component.

In order to use these tools, the suggested project is as follows:

project_dir/                --> where mct tool commands should be executed
  mithril_components/		--> contains all components
    component_name/             --> component_name directory
      component_name.js         --> the component
      test.js         			--> test of the component
      translation.json      	--> optional translation.json file
      component_name.less		--> optional component_name.less file

    ...           			--> other components follow the same structure
	package.json

Generate a translation JSON

Command: mct generate path/to/COMPONENT_NAME.js LANGUAGE

This will generate a translation.json file from all back-tick quoted words in the component. Default translations are equal to the original language that can be rewritten later.

If a translation.json file already exists, the original translations will be kept, while new words are be added.

Test components

Command: mct test path/to/COMPONENT_NAME.js LANGUAGE (LANGUAGE optional, only executes if a translation.json file exists)

This will start an example of your mithril component at localhost:9004, if that port is taken, sequential ports are tried until an open port is found.

To use mithril_component_tools for testing your mithril component you should have these files in your repo:

  • test.js: Required test file that is used for testing the component. This html of the component must be output through console logs.
  • COMPONENT_NAME.less: (Optional) Less styles if you need in your project. The tools render imported .less files from the bootstrap node_module. This requires the bootstrap node module. *Any less files in the component's directory must not have imports, or else it will not be included in the css. Bootstrap mixins and variables are automatically included.
  • translation.json: (Optional) Test resources you need in your app.

Publish components

Command: mct publish ./ LANGUAGE (LANGUAGE optional, only executes if a translation.json file exists)

*Requires bower to be installed

To use mithril_component_tools for testing your mithril component you need to have these files in your repo:

  • COMPONENT_NAME.less: (Optional) Less styles if you need in your project. The tools render imported .less files from the bootstrap node_module.
  • translation.json: (Optional) Test resources you need in your app.