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

@onjmin/cors-killer

v1.0.16

Published

CORS制限を回避するモジュール

Readme

cors-killer

CORS制限を回避するモジュール

特徴

  • CORS対応済みのURLは素通し
    既に CORS 対応済みの代表的なサービスの URL(例: Imgur、Wikipedia、Unsplash)や Base64 埋め込み形式の data URI は、そのまま返す設計。
    → 既に安全にアクセスできるものは手を加えず、可用性を落とさない。

  • その他の URL は自動でプロキシ経由
    上記以外の URL は、公開・無認証のプロキシをランダムで経由して安全に取得。
    使用するプロキシ例:

    • https://api.allorigins.win/raw?url=...
    • https://corsproxy.io/?...
    • https://api.codetabs.com/v1/proxy?quest=...
  • 余計な機能なし
    エクスポートされる関数は corsKiller ただ1つ。
    引数は文字列、返り値も文字列のシンプル設計。

  • Node.js / ブラウザ対応
    型安全な TypeScript で両環境で利用可能

  • おんJ民が作っている
    質問や相談はフォーラムで: 質問フォーラム

リンク集

インストール

npm i @onjmin/cors-killer

使用例

Node.js / ES Modules

import { corsKiller } from "@onjmin/cors-killer";

const url = "https://example.com/image.png"; // CORS非対応
const safeUrl = corsKiller(url);

console.log(safeUrl); // CORS対応済みURL
// https://api.allorigins.win/raw?url=https://example.com/image.png

ブラウザでの使用

const { corsKiller } = await import("https://cdn.jsdelivr.net/npm/@onjmin/cors-killer/dist/index.min.mjs");

const url = "https://example.com/image.png"; // CORS非対応
const safeUrl = corsKiller(url);

console.log(safeUrl); // CORS対応済みURL
// https://api.allorigins.win/raw?url=https://example.com/image.png

TODO

  • 現状は画像を前提に作っているが、動画、音楽、JS/CSS など、CORS が絡むその他のリソースにも対応可能。
  • その場合に備えて、テスト用関数やユーティリティも整備する必要がある。
  • コントリビュート大歓迎!興味のある方はぜひ pull request や issue を送ってほしい。

コントリビュート方法

  • 開発環境
    • 推奨エディタ: VSCode
    • 開発言語: TypeScript
    • 実行環境: Volta / pnpm / Biome
  • 開発コマンド
    • pnpm run dev: http://localhost:2783 から動作確認可能

ライセンス

開発者 / Author