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

primitive_bulk

v1.2.1

Published

Bulk output of primitive images

Downloads

1

Readme

Bulk output of primitive images

Simple wrapper module of primitive

Prequisite

Go

primitive works on Go lang, so you have to install Go before installing primitive

You can install with Homebrew

brew update
brew install go

Primitive

primitive

go get -u github.com/fogleman/primitive

Primitive would be installed your $GOPATH directory, which is under the your home directory as a default.

You might need add PATH in your .bash_profile (something like that), like the following

export PATH=$PATH:/Users/USERNAME/go/bin

Install

npm install primitive_bulk -g

Usage

primitive_bulk -i sample.jpg

As a default, this tool generate all mode (0 to 8) primitive images concurrently. It's faster but might be a heavy process for your machine.

If you want to generate them one by one, pass --sync option

primitive_bulk -i sample.jpg --sync

The output files are the following in the same directory

  • sample_m0_n300.jpg
  • sample_m1_n300.jpg
  • sample_m2_n300.jpg
  • sample_m3_n300.jpg
  • sample_m4_n300.jpg
  • sample_m5_n300.jpg
  • sample_m6_n300.jpg
  • sample_m7_n300.jpg
  • sample_m8_n300.jpg

Options

  • --format: You can set output format like svg, png, jpg, gif. The details of output format support, see Primitive. You can set multiple fomarts like --format svg,jpg.
  • -d, --dist : the directory to distribute the output images. If the directory is not existed, make it automatically.
  • --fname: enable to change the output file name like the following: ${name}_m6_n300.jpg
  • --output: pass primitive CLI as an output path. if you want to generate multiple images, don't use this option. otherwise generate images to the same file name (overriden)

The other options are passed to primitive CLI, so please referer to Primitive Usage.

  Usage: bin [options]


  Options:

    -V, --version           output the version number
    -i, --input <file
    -o, --output <file>
    -n, --num <string>
    -m, --mode <string>
    --rep <number>
    --nth <number>
    -r, --resize <number>
    -s, --size <number>
    -a, --alpha <number>
    --bg <string>
    -v, --verbose <string>
    --vv <string>
    -e, --ext <string>
    -d, --dist <dist>
    --sync
    -h, --help              output usage information