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

to-be-deleted-video-uploader-sdk

v4.2.6

Published

SDK для загрузки видео ===============

Downloads

98

Readme

SDK для загрузки видео

Установка:

npm i rupor-uploader-js-sdk

Важно: чтобы этот SDK работал, необходимо чтобы на сервере был Вот такой API.

Этот SDK позволяет выполнять загрузку видео по кускам (chunks). Размер одного куска настраивается, по умолчанию стоит значение в 1MB.

Работает это так: сначала идет POST запрос с meta информацией о видео, в том числе размер видео, например: POST на your-api.com/v1/ с payload

{
    "metadata": {
        "originalFilename": "4.mp4",
        "lastModified": 1640256801618,
        "fingerprint": "fd8e7ca5165cf69976c58b82fd18ea868223ede2"
    },
    "mimeType": "video/mp4",
    "size": 4291343,
    "uid": "C"
}

. Далее идут PUT запросы с offset, например: your-api.com/v1/some-unique-task-id/1048576, где offset равен 1048576

Он так же поддерживает функцию паузы, и многопоточную загрузку видео. Так же можно загружать несколько видео файлов за раз.

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

React

Создаем хук useUploadManager:

import { UploadTasksManager } from 'to-be-deleted-video-uploader-sdk';
...
...
export const useUploadManager = () => {
    const managerRef = useRef<UploadTasksManager>();

    const handleUploadDone = () => console.log('DONE!');
    const handleUploadProgress = (n:number) => console.log(n);

    useEffect(() => {
        if (managerRef.current) {
            return;
        }

        const manager = new UploadTasksManager(UPLOADER_SERVER_URL, 'SOME_UUID', 4);
        managerRef.current = manager;
        managerRef.current.on('upload-progress', handleUploadProgress);
        managerRef.current.on('all-done', handleUploadDone);

        const ref = managerRef;

        // eslint-disable-next-line consistent-return
        return () => {
            ref.current!.removeAllListeners();
        };
    }, []);

    return {
        managerRef,
    };
};

В компоненте:

import type { FC } from 'react';

import { useUploadManager } from './hooks/useUploadManager';

export const AddVideo: FC = () => {
    const { managerRef } = useUploadManager();

    const handleSelectFiles = async (video: File) => {
        // пользователь выбрал видео
        try {
            const task = await managerRef.current.upload(video);
            //далее делаем все что нужно с task
            ...
            ... 

            await task.pause()
            ...
            await task.resume()
        } catch (error) {
            console.error(error);
        }
    };

    return (
        <CustomFileInput onSelectFiles={handleSelectFiles}/>
    );
};

API

UploadTasksManager

| Constructor arg | Type | Description | | ----------- | ----------- |------| | url | string | Ссылка на uploader сервис, Важно: чтобы этот SDK работал, необходимо чтобы на сервере был Вот такой API. | | uid | string | уникальный id | | maxConcurrent | number | максимальное кол-во PUT запросов в параллель | | silent? | boolean | Показать/скрыть console.logs, по умолчанию true |

| Method | Args | Return Type | Description | | ----------- | ----------- | -----| | get | Task | | | Paragraph | Text | |

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

const manager = new UploadTasksManager('https://my-uploader.ru/api/v1/', 'ASD', 4);

Task