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,
flag,
type,
style,
format,
alpha
);
Animated
createAnimated(
image,
flag,
type,
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/>.