0.0.3 • Published 2 years ago
svgapi v0.0.3
svgapi
Access to 200k+ SVG Icons
SVG API wrapper
Installation
yarn add svgapi
or
npm install --save svgapi
Search icons
import { search } from 'svgapi';
const result = await search(domainKey, 'apple', page, limit);
Create instance
import { create } from 'svgapi';
const api = create(domainKey, limit);
const result = await api.search('apple', page, limit);
Result
{
{
total: 298,
term: 'apple',
page: 1,
limit: 50,
count: 50,
icons: [
{
id: '6482',
slug: 'apple',
title: 'Apple',
url: 'https://cdn.svgapi.com/vector/6482/apple.svg',
svg: '<svg version="1.1">...</svg>'
},
// ...
],
}
Types
Result Interface
interface SvgApiResultInterface {
term: string;
total: number;
count: number;
page: number;
limit: number;
icons: SvgApiIconInterface[];
}
Icon interface
interface SvgApiIconInterface {
id: string;
slug: string;
title: string;
url: string;
svg?: string;
}