1.3.0 • Published 9 years ago
@ftchinese/social-images v1.3.0
Generate social platform images.
Installation
npm install @ftchinese/social-images --save-devAPI
For node.js only. NOT frontend js.
socialImages(options)options is an object with:
toString. Destination directory relative to node.js running process. Defaultpublic/social-images.pngBoolean. Also produce png files when generating svg. Defaulttrue.colorString | null. Optional. Color to draw the icon.nullremoves any color, and SVG without filling color is black. If omitted, use the icon's default color#fff.backgroundString | null. Optional. Color set on icon's background.nullremoves the background. If omitted, use the icon's official color.- Returns promise.
Example
socialImages({
to: 'social-images', // path.resolve(process.cwd(), 'social-images')
png: false, // do not generate png files. Only svg.
color: '#a7a59b',
background: null // removes background
})
.catch(err => {
console.log(err);
});1.3.0
9 years ago