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

ikota

v1.0.1

Published

CLI automation tool for working with React

Downloads

11

Readme

Overview

Ikota (Russian word for "hiccups", pronounced /ikóta/) is a CLI automation tool for working with React. It offers an automated component generator tool & more soon.

Install

$ npm i -g ikota
$ ikota component # or
$ npx ikota component

Usage

CLI offers a single command - component as for now.

With this command you can single-handedly generate essentially useful component folders with:

  • index.ts/js - Export file
  • config.ts/js - Configuration file
  • component.tsx/jsx - Main component file
  • styles.module.ext - Styling file

But first of all you'd wanna initialize the configuration file for ikota: ikota.config.js. To do that either use the ikota config command or run ikota component that will take you through the options that you can provide.

Note: ikota config will take an entire survey over all of the options, ikota component on the other hand only initializes essential options.

Example

Plugins

Plugins are the features that extend the work of ikota component generation. With them you can use custom preprocessors & much more. Some of the examples would be:

  • @ikota/example - An example plugin implementing Stylus preprocessor
  • more soon...

Create a plugin

If you want to make a plugin you will need to make an NPM package for that. With the example plugin you can have a quick start.

Plugin with preprocessor

To clarify, a preprocessor in ikota isn't always a CSS proprocessor but rather a custom template for component and to export one you'd need to export components key like this:

Typescript

export const components = {
  ...
}

CommonJS

module.exports = {
  components: {
    ...
  }
}
// or
exports.components = {
  ...
}

Inside of the components object you define preprocessors where the key name stands for its value & name and the object of the preprocessor per se contains functions & file names for:

  • index - Export file
  • config - Configuration file
  • component - Main component file
  • style - Styling file

Note: It's recommended for you to name your preprocessor in lowercase as the ikota config automatically capitalizes your name and there's no need for doing that manually. Also consider using kebab-case over whitespaces.

Your average plugin would look like this:

export const components = {
  // Key name stands for preprocessor name
  'example-styl': {
    // Component file
    component: {
      // Name of the file
      // Leave the name empty if you don't want to create a file
      fileName: (config: IkotaConfig, name: string) => "...",
      // String to write file as
      function: (config: IkotaConfig, name: string) => "...",
    },
    // Styling file
    style: {
      fileName: (config: IkotaConfig, name: string) => "...",
      function: (config: IkotaConfig, name: string) => "...",
    },
    // Config file
    config: {
      fileName: (config: IkotaConfig, name: string) => "...",
      function: (config: IkotaConfig, name: string) => "...",
    },
    // Exports file
    index: {
      fileName: (config: IkotaConfig, name: string) => "...",
      function: (config: IkotaConfig, name: string) => "...",
    },
  },
};

Note: In future updates such approach can be changed but as for now you can use this.

Documentation

All the available documentation regarding the usage of the CLI is displayed in a help command:

$ ikota # or
$ ikota help

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is under MIT license. You can freely use it for your own purposes.