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

piconvert

v0.5.2

Published

Convert pictures to other formats. Supports ai, cdr, vsd, pdf, and more formats. GitHub Actions & CLI Tool.

Downloads

32

Readme

piconvert

Convert pictures to other formats. GitHub Actions, CLI Tool, and Node Package.

Features

  • Import (input) formats: ai, cdr, vsd, pdf, jpg, png, gif, and bmp
  • Export (output) formats: svg, png, ps, eps, pdf, emf, wmf, and xaml.

Usage

GitHub Actions

- name: Piconvert
  uses: JacobLinCool/[email protected]
    with:
      src: ./pictures
      dist: ./piconvert
      inputs: ai
      outputs: svg,png
      force: false
      verbose: false

See action.yml for more details.

CLI Tool

npm install -g piconvert
Usage: piconvert [options] [path]

Arguments:
  path                     Source path. If it's a directory, all files matched selected import types in it and its subdirectories will be converted. (default: "pictures")

Options:
  -V, --version            output the version number
  -d, --dir <directory>    Output directory (default: "piconvert")
  -i, --inputs <formats>   Import (input) formats. Supports: ai,cdr,vsd,pdf,jpg,jpeg,png,gif,bmp (default: "ai")
  -o, --outputs <formats>  Export (output) formats. Supports: svg,png,ps,eps,pdf,emf,wmf,xaml (default: "svg,png")
  -f, --force              Overwrite existing files (default: false)
  -s, --silent             Silent mode, no output (default: false)
  -v, --verbose            Verbose mode, print all Inkscape output (default: false)
  -h, --help               display help for command

Commands:
  install [options]

CLI Demo

Library

npm install piconvert
# or: yarn add piconvert
# or: pnpm install piconvert
const { Converter } = require("piconvert");
// or using ESM "import":
// import { Converter } from "piconvert";

const converter = new Converter()
  .import("ai")
  .export("svg")
  .export("png", [128, 256, "256x128", "x512"]);

converter.run("./src", "./dest");

Config File

There are two types of config files: folder-level and file-level.

Folder-level Config File

The folder-level config file is a YAML file named piconvert.yml, piconvert.yaml, .piconvert.yml, or .piconvert.yaml.

The configurations in this file will be applied to all files in the folder.

File-level Config File

The file-level config file is a YAML file named with the same name as the source file, for picture_123.ai, it should be named picture_123.yml or picture_123.yaml.

Config File Structure

The config file structure is as follows:

svg:
png:
  - 128
  - "256x128"
  - "x512"
pdf:

All the keys in the config file are supported export formats with an optional value of sizes.

Priority

The priority of config files is as follows:

  1. File-level config file
  2. Folder-level config file
  3. Parent folder-level config file (if exists)
  4. Default configs

Requirement

If you are using GitHub Actions, then you don't need to install any dependencies.

But if you are using the cli tool on your computer, make sure you have installed inkscape first.

(You can use piconvert install to install inkscape. On linux, it uses apt. On macOS, it uses brew. On Windows, it uses choco.)

Links