npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aerosstube/anime-parser-kodik-ts

v1.1.2

Published

TypeScript библиотека для парсинга аниме с сайта Kodik с полной типизацией

Readme

Anime Parser TypeScript

TypeScript версия парсера аниме для сервиса Kodik с полной типизацией.

Установка

Из npm

npm install @aerosstube/anime-parser-kodik-ts

Для разработки

git clone https://github.com/aerosstube/anime-parser-kodik-ts.git
cd anime-parser-kodik-ts
npm install

Сборка

npm run build

Запуск

Пример использования

npm run example

Использование

Основные классы

import { createParser, createSearch, createList, KodikParser } from '@aerosstube/anime-parser-kodik-ts';

// Создание парсера
const parser = await createParser(); // Автоматически получит токен
// или
const parser = new KodikParser('your_token');

// Поиск аниме
const results = await parser.search('Наруто', 10, true, null, false, true);

// Поиск по ID
const resultsById = await parser.searchById('1735', 'shikimori');

// Получение информации
const info = await parser.getInfo('1735', 'shikimori');

// Получение ссылки на серию
const [link, quality] = await parser.getLink('1735', 'shikimori', 1, '609');

API классы

// Поиск через API
const search = await createSearch();
const results = await search
    .title('Атака титанов')
    .limit(5)
    .anime_kind('tv')
    .execute_async();

// Список через API
const list = await createList();
const listResults = await list
    .limit(10)
    .sort('year')
    .order('desc')
    .anime_genres(['Экшен'])
    .execute_async();

Типы

AnimeResult

interface AnimeResult {
    title: string;
    title_orig: string;
    other_title: string | null;
    type: string;
    year: number;
    screenshots: string[];
    shikimori_id: string | null;
    kinopoisk_id: string | null;
    imdb_id: string | null;
    worldart_link: string | null;
    additional_data: Record<string, unknown>;
    material_data: Record<string, unknown> | null;
    link: string;
}

Translation

interface Translation {
    id: string;
    title: string;
    type: string;
    is_voice: boolean;
}

AnimeInfo

interface AnimeInfo {
    translations: Translation[];
    series_count: number;
}

SearchResponse

interface SearchResponse {
    total: number;
    time: string;
    results: AnimeResult[];
}

Ошибки

Все ошибки наследуются от общего базового класса KodikError:

  • TokenError — проблемы с токеном
  • ServiceError — ошибки сервиса
  • PostArgumentsError — неверные аргументы
  • NoResults — нет результатов
  • UnexpectedBehavior — неожиданное поведение
  • QualityNotFound — качество не найдено
  • AgeRestricted — возрастные ограничения
  • TooManyRequests — слишком много запросов
  • ContentBlocked — контент заблокирован
  • ServiceIsOverloaded — сервис перегружен
  • DecryptionFailure — ошибка расшифровки

Константы (Enums)

Типы аниме

import { AnimeKind } from '@aerosstube/anime-parser-kodik-ts';

AnimeKind.TV    // 'tv'
AnimeKind.MOVIE // 'movie'
AnimeKind.OVA   // 'ova'
AnimeKind.ONA   // 'ona'
// ...

Жанры

import { AnimeGenres } from '@aerosstube/anime-parser-kodik-ts';

AnimeGenres.ACTION  // 'Экшен'
AnimeGenres.COMEDY  // 'Комедия'
AnimeGenres.DRAMA   // 'Драма'
// ...

Сортировка

import { SortList, OrderList } from '@aerosstube/anime-parser-kodik-ts';

SortList.YEAR       // 'year'
SortList.CREATED_AT // 'created_at'
OrderList.ASC       // 'asc'
OrderList.DESC      // 'desc'

Структура проекта

anime-kodik-parser/
├── src/
│   ├── lib/
│   │   ├── errors.ts          # Классы ошибок
│   │   ├── internal_tools.ts  # HTTP-обёртки
│   │   ├── parser_kodik.ts    # Основной парсер
│   │   └── api_kodik.ts       # API классы и enums
│   ├── types/
│   │   └── index.ts           # Интерфейсы и типы
│   ├── index.ts               # Главный экспорт
│   └── example.ts             # Пример использования
├── dist/                      # Скомпилированные файлы
├── package.json
├── tsconfig.json
└── README.md

Требования

  • Node.js >= 14
  • TypeScript >= 5.0
  • Зависимости: axios, cheerio, base-64

Лицензия

MIT