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 🙏

© 2025 – Pkg Stats / Ryan Hefner

paternator

v2.1.8

Published

helper for create easyli component on canopy

Readme

README

Allow to create easily a component automatically inside a react architecture, or any javascript package project.

Installation

npm install paternator -D

:::info -E is for dev dependencies. :::

-D is for dev dependencies.

setup paternator

You got two choices.

  • 1 Into your package.json file, from your project:
  "paternator": {
    "models": "models/files.js",
    "path": "app/"
  },

This usage is much faster, prefer it.

  • 2 Inside a json in your project, named conf.paternator.json
{
	"paternator": {
		"models": ["models/files.js", "an/other/pattern.tpl"],
		"path": "app/"
	}
}

models : (string) path to the special file (see bellow) wich contains all the files to duplicate.

path : (string or array) folder path where all the patern will be duplicate. If you pass an array, it mean you have differents pattern available. Then, you will be abble to choose the pattern of your choices by a dialog box.

files.js (models)

files.js contain a kind of "map" / "plan" of the files you want to generate automatically.

It's a json object, where each json will be the future files.

Each json object have two parts, both are strings. First is the name of the futur file, second its content.

Example :

exports.entrance = ['index.js',`
import React from 'react';
import s from './[name].css';

const [Name] = ({ id }) => (
  <div>
  </div>
);

[Name].propTypes = {
  id: React.PropTypes.number.isRequired,
};

export default [Name];
`];

exports.index = ['[name].css',`
	body{background: #fff;}
`];

This example generate two files, one js file and a css file. The CSS file will have the component name. For using the name to the variables, you just have to use the mask [name], or [Name] if you want it with a majuscule on the first letter. You can also duplicate a full structure if you feel like it by using a path with /. Example:

exports.entrance = ['this/is-a/directory/index.js',`...etc

Use

When you will duplicate the package by CLI, component's name will be asked. From that, a folder with the component's name will be generate automatically to your folder target. Inside this folder, you will found all the files you set up in your models.

I invite to make a npm script shortcut for a better use.

  "scripts": {
    "paternator": "node node_modules/paternator"
  },

resources

https://github.com/korvus/paternator