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

anime365wrapper

v1.1.2

Published

Modern TypeScript wrapper for anime365.ru (smotret-anime) API with full type support and ESM/CommonJS compatibility

Readme

Anime365Wrapper

npm version npm downloads Node.js version TypeScript

Anime365Wrapper — это современная TypeScript обёртка для API anime365.ru (smotret-anime), обеспечивающая полную типизацию и поддержку как ESM, так и CommonJS модулей.

✨ Особенности

  • 🔥 Полная поддержка TypeScript с экспортом всех типов
  • 📦 ESM и CommonJS совместимость
  • 🛡️ Безопасность - корректная обработка авторизации
  • 🚀 Современный API с async/await поддержкой
  • 📚 Полная типизация всех методов и возвращаемых данных
  • 🔧 Гибкая настройка базового URL и User-Agent
  • Быстрая работа с кэшированием токенов

📋 Требования

  • Node.js 10.0.0 или выше
  • TypeScript 4.0+ (опционально, для типизации)

🚀 Установка

# npm
npm install anime365wrapper

# yarn
yarn add anime365wrapper

# pnpm
pnpm add anime365wrapper

📖 Быстрый старт

ESM / TypeScript

import { SmotretAnimeAPI, UserSession } from 'anime365wrapper';
import type { Translation, Series } from 'anime365wrapper';

const api = new SmotretAnimeAPI();

// Получение списка переводов
const translations: Translation[] = await api.getTranslations('recent');
console.log(`Получено переводов: ${translations.length}`);

// Получение списка аниме
const series: Series[] = await api.getSeriesList({ limit: 10 });
console.log(`Получено серий: ${series.length}`);

CommonJS

const { SmotretAnimeAPI, UserSession } = require('anime365wrapper');

const api = new SmotretAnimeAPI();

// Получение списка переводов
api.getTranslations('recent')
  .then(translations => {
    console.log(`Получено переводов: ${translations.length}`);
  })
  .catch(console.error);

🔐 Авторизация

SmotretAnimeAPI

import { SmotretAnimeAPI } from 'anime365wrapper';

const api = new SmotretAnimeAPI();

// Авторизация
try {
  const token = await api.login('[email protected]', 'your_password');
  console.log('Токен получен:', token);
  
  // Теперь можно использовать методы, требующие авторизации
  const user = await api.getCurrentUser();
  console.log('Пользователь:', user);
} catch (error) {
  console.error('Ошибка авторизации:', error.message);
}

UserSession (рекомендуется)

import { UserSession } from 'anime365wrapper';

const session = new UserSession();

// Авторизация с автоматическим сохранением токена
try {
  const token = await session.login('[email protected]', 'your_password');
  console.log('Успешная авторизация');
  
  // Токен автоматически сохраняется для последующих запросов
  const translations = await session.getTranslations('recent');
  console.log('Переводы:', translations);
} catch (error) {
  console.error('Ошибка:', error.message);
}

📚 API Документация

SmotretAnimeAPI

Конструктор

new SmotretAnimeAPI(baseUrl?: string, userAgent?: string, accessToken?: string)

Параметры:

  • baseUrl - Базовый URL API (по умолчанию: https://smotret-anime.online/api)
  • userAgent - User-Agent для запросов (по умолчанию: Anime365Wrapper/1.0)
  • accessToken - Токен авторизации (опционально)

Методы

🔐 Авторизация
// Установка токена
setAccessToken(token: string): void

// Авторизация по email и паролю
login(email: string, password: string): Promise<string>
📺 Переводы
// Получение списка переводов
getTranslations(feed?: 'recent' | 'id' | 'all', afterId?: number): Promise<Translation[]>

// Получение перевода по ID
getTranslationById(id: number): Promise<Translation>

// Получение данных для встраивания
getTranslationEmbed(id: number): Promise<EmbedTranslation>
🎬 Аниме (серии)
// Получение списка аниме
getSeriesList(params?: {
  fields?: string;
  chips?: string;
  myAnimeListId?: number;
  query?: string;
  pretty?: number;
  limit?: number;
  offset?: number;
}): Promise<Series[]>

// Получение аниме по ID
getSeriesById(id: number): Promise<Series>
📝 Эпизоды
// Получение эпизода по ID
getEpisodeById(id: number): Promise<Episode>
👤 Пользователь
// Получение информации о текущем пользователе (требует авторизации)
getCurrentUser(): Promise<User>

UserSession

// Конструктор
new UserSession(apiBaseUrl?: string, userAgent?: string)

// Авторизация с сохранением токена
login(email: string, password: string): Promise<string>

// Установка токена
setAccessToken(token: string): void

// Прокси-методы
getTranslations(feed?: 'recent' | 'id' | 'all', afterId?: number): Promise<Translation[]>

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

Поиск аниме

import { SmotretAnimeAPI } from 'anime365wrapper';

const api = new SmotretAnimeAPI();

// Поиск по названию
const searchResults = await api.getSeriesList({
  query: 'naruto',
  limit: 10
});

console.log('Найдено аниме:', searchResults.length);
searchResults.forEach(series => {
  console.log(`- ${series.title} (${series.year})`);
});

Получение информации о переводе

import { SmotretAnimeAPI } from 'anime365wrapper';

const api = new SmotretAnimeAPI();

// Получение последних переводов
const recentTranslations = await api.getTranslations('recent');

if (recentTranslations.length > 0) {
  const firstTranslation = recentTranslations[0];
  
  // Получение детальной информации
  const detailedTranslation = await api.getTranslationById(firstTranslation.id);
  console.log('Детали перевода:', detailedTranslation);
  
  // Получение данных для встраивания
  const embedData = await api.getTranslationEmbed(firstTranslation.id);
  console.log('Embed данные:', embedData);
}

Работа с сессией

import { UserSession } from 'anime365wrapper';

const session = new UserSession();

async function main() {
  try {
    // Авторизация
    await session.login('[email protected]', 'your_password');
    
    // Получение переводов (токен автоматически используется)
    const translations = await session.getTranslations('recent');
    
    // Получение информации о пользователе
    const user = await session.getCurrentUser();
    console.log('Пользователь:', user);
    
  } catch (error) {
    console.error('Ошибка:', error.message);
  }
}

main();

🏗️ Типы данных

Библиотека экспортирует все необходимые типы:

import type {
  Translation,
  Series,
  Episode,
  User,
  EmbedTranslation,
  ApiResponse
} from 'anime365wrapper';

Translation

interface Translation {
  id: number;
  title: string;
  type: string;
  seriesId: number;
  episodeId: number;
  isActive: number;
  priority: number;
  authorsList: string[];
  // ... и другие поля
}

Series

interface Series {
  id: number;
  title: string;
  year: number;
  type: string;
  numberOfEpisodes: number;
  isActive: number;
  isAiring: number;
  allTitles: string[];
  // ... и другие поля
}

🛠️ Разработка

Установка зависимостей

git clone https://github.com/thedvxchsquad/anime365wrapper.git
cd anime365wrapper
npm install

Сборка

npm run build

Тестирование

npm test

📞 Поддержка