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

pfp.lgbt-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pfp.lgbt-wrapper

A pfp.lgbt Wrapper

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by900%
Maintainers
1
Weekly downloads
 
Created
Source

npm npm install size

pfp.lgbt Wrapper

Installation

npm i pfp.lgbt-wrapper

Unofficial wrapper for pfp.lgbt!

Usage

Get all available flags

Returns Promise<Object>

getFlags();
Get a flag's image

Returns Promise<Buffer>

getFlag(flag);
Lgbtify an image

Returns Promise<Buffer>

Static

createStatic(
	image, // The image to lgbtify. A Buffer or an image url
	flag, // The Pride flag to add. A valid Pride flag
	type, // The effect type. Any of circle | overlay | square | background - Defaults to circle
	style, // The effect style. Any of solid | gradient - Defaults to solid
	format, // The output format. Any of jpg | png - Defaults to png
	alpha // The effect's alpha
);

Animated

createAnimated(
	image,
	flag,
	type, // Any of circle | square - Defaults to circle
	alpha
);

Examples

Javascript
const PfPLGBT = require('pfp.lgbt-wrapper');
const fs = require('fs');

const pfp = new PfPLGBT();

async function example() {
	pfp.getFlags().then(console.log);

	await pfp.getFlag('pan').then(result => fs.writeFileSync('./panFlag.png', result));

	pfp.createStatic(fs.readFileSync('./panFlag.png'), 'pride').then(result => fs.writeFileSync('./staticImage.png', result));

	pfp.createAnimated(fs.readFileSync('./panFlag.png'), 'pride', 'square', 100).then(result => fs.writeFileSync('./animatedImage.gif', result));
}

example();
Typescript
import PfPLGBT from 'pfp.lgbt-wrapper';
import * as fs from 'fs';

const pfp = new PfPLGBT();

async function example() {
	pfp.getFlags().then(console.log);

	await pfp.getFlag('pan').then(result => fs.writeFileSync('./panFlag.png', result));

	pfp.createStatic(fs.readFileSync('./panFlag.png'), 'pride').then(result => fs.writeFileSync('./staticImage.png', result));

	pfp.createAnimated(fs.readFileSync('./panFlag.png'), 'pride', 'square', 100).then(result => fs.writeFileSync('./animatedImage.gif', result));
}

example();

License

pfp.lgbt-wrapper, an unofficial wrapper for pfp.lgbt
Copyright (C) 2020 VenNeptury

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Keywords

FAQs

Package last updated on 15 Jun 2020

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