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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bizmori/sdk

v0.1.0

Published

Official MORI API SDK for TypeScript/JavaScript - Anti-AI protection and invisible watermarking

Readme

@bizmori/sdk

공식 MORI API TypeScript/JavaScript SDK입니다.

  • Anti-AI: 이미지에 AI 학습 방해 필터 적용
  • Invisible Watermark: 비가시성 워터마크 삽입 및 검출

설치

npm install @bizmori/sdk
# 또는
yarn add @bizmori/sdk
# 또는
pnpm add @bizmori/sdk

요구사항

  • Node.js 18.0.0 이상
  • TypeScript 5.0 이상 (TypeScript 사용 시)

빠른 시작

import { MoriClient } from '@bizmori/sdk';
import fs from 'fs';

const client = new MoriClient({
  apiKey: process.env.MORI_API_KEY!,
});

// 1. Anti-AI 보호 처리
async function protectImage() {
  // 주문 생성
  const order = await client.antiAi.createOrder({
    files: [{ fileName: 'image.jpg' }],
    orderName: 'My Protection Order',
  });

  // 파일 업로드
  const buffer = fs.readFileSync('./image.jpg');
  await client.upload(order.files[0], buffer);

  // 주문 확인
  await client.orders.confirm(order.orderId);

  // 완료 대기
  const result = await client.orders.waitForCompletion(order.orderId, {
    pollingInterval: 2000,
    timeout: 300000,
    onProgress: (status) => console.log('Status:', status.status),
  });

  // 다운로드
  if (result.status === 'complete') {
    const downloadUrl = await client.orders.getDownloadUrl(order.orderId);
    console.log('Download URL:', downloadUrl);
  }
}

주요 기능

Anti-AI (학습 방지)

const order = await client.antiAi.createOrder({
  files: [
    { fileName: 'image1.jpg' },
    { fileName: 'image2.png' },
  ],
  orderName: 'Protection Order',
});

Watermark 삽입

const order = await client.watermark.embed({
  files: [{ fileName: 'artwork.jpg' }],
  orderName: 'Watermark Order',
});

Watermark 검출

const order = await client.watermark.extract({
  originalFiles: [
    { fileName: 'original1.jpg' },
    { fileName: 'original2.jpg' },
  ],
  watermarkedFile: { fileName: 'suspected.jpg' },
});

// 결과 확인
const result = await client.orders.waitForCompletion(order.orderId);
console.log(result.status); // 'detected' or 'undetected'

파일 업로드

// 단일 파일
await client.upload(order.files[0], buffer);

// 여러 파일 동시 업로드
await client.uploadAll([
  [order.files[0], buffer1],
  [order.files[1], buffer2],
]);

Webhook 설정

// 웹훅 등록
const { secret } = await client.webhook.register('https://my-server.com/webhook');

// 서명 검증 (서버에서)
const isValid = await client.webhook.verifySignature(
  requestBody,
  request.headers['x-mori-signature'],
  secret
);

// 페이로드 파싱
const event = client.webhook.parsePayload(requestBody);
console.log(event.eventType); // 'ORDER.ANTI_AI.PROCESSED'

설정 옵션

const client = new MoriClient({
  apiKey: 'your-api-key',            // 필수
  baseUrl: 'https://morimori.app/api/v2',  // 선택 (기본값)
  timeout: 30000,                    // 선택: 요청 타임아웃 (ms)
  maxRetries: 3,                     // 선택: 최대 재시도 횟수
  retryDelay: 1000,                  // 선택: 재시도 기본 딜레이 (ms)
});

에러 처리

import {
  MoriError,
  MoriAuthError,
  MoriValidationError,
  MoriNotFoundError,
  MoriRateLimitError,
  MoriServerError,
  MoriTimeoutError,
} from '@bizmori/sdk';

try {
  await client.orders.get('invalid-id');
} catch (error) {
  if (error instanceof MoriAuthError) {
    console.error('인증 오류:', error.message);
  } else if (error instanceof MoriNotFoundError) {
    console.error('주문을 찾을 수 없음:', error.code);
  } else if (error instanceof MoriRateLimitError) {
    console.error('요청 한도 초과');
  } else if (error instanceof MoriError) {
    console.error('API 오류:', error.code, error.message);
  }
}

Zero Copy 모드

처리된 이미지를 고객 S3로 직접 업로드:

const order = await client.antiAi.createOrder({
  files: [{ fileName: 'image.jpg' }],
  mode: { zeroCopy: true },
  outputTargets: [
    {
      fileKey: 'output/protected-image.jpg',
      url: 'https://your-bucket.s3.../presigned-upload-url',
      expiresAt: '2024-01-15T12:00:00Z',
    },
  ],
});

지원 이미지 형식

  • JPG, JPEG, PNG
  • GIF (정지 이미지만)
  • WEBP (정지 이미지만)

라이선스

MIT License - LICENSE 참조