0.0.3 • Published 2 years ago

svgapi v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Maintenance Maintaner Website shields.io made-with-Markdown made-for-VSCode GitHub license Profile views GitHub contributors GitHub issues

GitHub forks GitHub stars GitHub watchers GitHub followers

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;
}
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago