Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-invader-gen

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-invader-gen

Generate Space-Invader-like sprites as SVG images

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

SVG "Invader" Sprite Generator

Code Coverage

CLI Usage

Installation

npm install -g svg-invader-gen

CLI Options

svg-invader-gen [OPTIONS]
  • -x #, --pixel-width=# [NUMBER] Width of "pixel" (Default is 20)
  • -y #, --pixel-height=# [NUMBER] Height of "pixel" (Default is 20)
  • -w #, --pixels-wide=# [NUMBER] Number of pixels wide to make the sprite (Default is 5)
  • -h #, --pixels-high=# [NUMBER] Number of pixels high to make the sprite (Default is 5)
  • -n, --non-symmetric [FLAG] Don't mirror the sprite across the vertical axis
  • -o [TYPE], --output-type=[TYPE] [STRING] Output type: "svg", "html", or "text" (Default is "svg")

Module usage

Installation

npm install -S svg-invader-gen

JS

const invaderGen = require('svg-invader-gen');

const opts = {
  pixelsWide: 5,
  pixelsHigh: 5,
  pixelWidth: 20,
  pixelHeight: 20,
  verticalSymmetry: true,
  outputType: 'svg',
};

const go = () => {
  const sprite = invaderGen.getSprite(opts);

  const svg = invaderGen.outputSprite(opts, sprite);

  console.log(svg);
};

go();

TypeScript

import { Sprite, SpriteOptions, getSprite, outputSprite } from 'svg-invader-gen';

const opts: SpriteOptions = {
  pixelsWide: 5,
  pixelsHigh: 5,
  pixelWidth: 20,
  pixelHeight: 20,
  verticalSymmetry: true,
  outputType: 'svg',
};

const go = () => {
  const sprite: Sprite = getSprite(opts);
  const svg: string = outputSprite(opts, sprite);

  console.log(svg);
};

go();

Keywords

FAQs

Package last updated on 26 Nov 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc