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

text-cornucopia-cli

v1.0.3

Published

cli for text cornucopia tool https://hsalmeida.github.io/text-cornucopia/

Downloads

8

Readme

 _____         _      ____                                       _        
|_   _|____  _| |_   / ___|___  _ __ _ __  _   _  ___ ___  _ __ (_) __ _  
  | |/ _ \ \/ / __| | |   / _ \| '__| '_ \| | | |/ __/ _ \| '_ \| |/ _` | 
  | |  __/>  <| |_  | |__| (_) | |  | | | | |_| | (_| (_) | |_) | | (_| | 
  |_|\___/_/\_\\__|  \____\___/|_|  |_| |_|\__,_|\___\___/| .__/|_|\__,_| 
                                                          |_|

generate a bunch of strings from a list using a pattern, this is a cli from text cornucopia tool https://hsalmeida.github.io/text-cornucopia/

Highlights

  • cli commands
  • multi outputs types
  • redis support (beta)

Install

$ npm install -g cornucopia

Before Usage

some parameters ;)

generate a input.properties file in any directory, inside the module already has a fully generated file, you can use for a example or create a new one following this steps:

Cornucopia Input Parameters

inside the input.properties, create this string: [cornucopia], this is a key for input parameters. create this strings above the key:

input.directory = 
input.file = 
input.type = 
input.header = 
input.separator = 

fill in this parameters:

  • with the directory where the list file is
  • the name of the file (example: megaList.txt)
  • the type of input file: txt, csv or any file with a list of strings
  • if the has a header fill in with true or false if hasn`t
  • the separator of the strings in input file, for instance, , comma is the most common

Output Parameters

Your can define (more to come) 3 outputs:

  • txt, with [txt] key in input.properties file
  • csv, with [csv] key in input.properties file
  • redis (beta), , with [redis] key in input.properties file

In txt and csv has two initial parameters

out.directory = 
out.file = 
out.pattern =

fill in this parameters:

  • with the directory where file will be write
  • the name of the file, example: result(.txt for txt)(.csv for csv)
  • the pattern (read about pattern above)

How to Write Patterns

the cornucopia split the input file line by line, using the separator parameter each string separated by the separator acquire a number, the first is 0 and it will be replaced in the pattern using $ plus the number of string.

Example: megaList.txt

1921,Albert Einstein,Frederick Soddy,None,Anatole France,Hjalmar Branting;Christian Lous Lange
1922,Niels Bohr,Francis William Aston,Archibald Hill;Otto Fritz Meyerhof,Jacinto Benavente,Fridtjof Nansen
1923,Robert Andrews Millikan,Fritz Pregl,Frederick Banting;John James Rickard Macleod,W. B. Yeats,None
1924,Manne Siegbahn,None,Willem Einthoven,Władysław Reymont,None

the out.pattern can be

out.pattern = in $0 the nobel prize of Physics goes to $1, Chemistry for $2, Medicine for $3, Literature for $4 and Peace for $5.

the output file (if the parameters is right fill in) can be:

in 1921 the nobel prize of Physics goes to Albert Einstein, Chemistry for Frederick Soddy, Medicine for None, Literature for Anatole France and Peace for Hjalmar Branting;Christian Lous Lange.
in 1922 the nobel prize of Physics goes to Niels Bohr, Chemistry for Francis William Aston, Medicine for Archibald Hill;Otto Fritz Meyerhof, Literature for Jacinto Benavente and Peace for Fridtjof Nansen.
in 1923 the nobel prize of Physics goes to Robert Andrews Millikan, Chemistry for Fritz Pregl, Medicine for Frederick Banting;John James Rickard Macleod, Literature for W. B. Yeats and Peace for None.
in 1924 the nobel prize of Physics goes to Manne Siegbahn, Chemistry for None, Medicine for Willem Einthoven, Literature for Władysław Reymont and Peace for None.

You can output to csv and txt at the same time, using diferent patterns, just write out.pattern above [txt] and [csv] keys

Limitations

Yout can use only 9 keys in patterns, from $0 to $9.

Usage

$ cornucopia

Coming Soon

  • elasticsearch
  • dynamic detection
  • more smart CLI
  • remove limitations of pattern keys

Maintainers

License

ISC