🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more →
Socket
Book a DemoInstallSign in
Socket

@image-tracer-ts/nodejs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@image-tracer-ts/nodejs

Platform-specific bindings for image-tracer-ts. Turn images into SVG files in Nodejs.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

@image-tracer-ts/nodejs

Trace images into SVG in nodejs.

alt Bitmap to Svg

Adds nodejs-specific convenience methods to @image-tracer-ts/core to load data from different image types (PNG, JPEG, etc.) and locations (mainly filenames), as well as command line support.

Provides ESM and CJS packages.

A similar package is available for browser usage in @image-tracer-ts/browser.

Basic Usage

import { ImageTracerNodejs } from '@image-tracer-ts/nodejs' 
const svgString = ImageTracerNodejs.fromFileName(
  fileName: string,
  options: Partial<ImageTracerNodejsOptions> | null = null,
  drawer: ImageDrawer<string> | null = null
): Promise<void>

CLI

To trace images from the command line, run the .cjs module with a path to an image along with the desired options (prefixed with --):

$ node ./packages/nodejs/dist/image-tracer-nodejs.cjs ./image.png --out image.svg --fillStyle stroke

Options

For tracer options see @image-tracer-ts/core.

When passed as command line parameter, options have to be prefixed with -- (i.e. --blurRadius 5).

Package specific options:

OptionTypeDefaultDescription
outputpng | svg | `(pngsvg)[]`svg
outstringinput file nameOutput filename (file type extension will be added if necessary)
presetPreset name from core packagenullUse a named preset

Keywords

image

FAQs

Package last updated on 04 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts