Skip to main content
Home

🚚 Deliver any files in the GitHub repository

This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
2 months ago (1.5.0)

Reproxy

🚚 Deliver any files in the GitHub repository


GitHub Release JSR JSR Score
CI Release pre-commit codecov

Repobeats Analytics Image



💡 Concepts

You can host your specific file on the GitHub repository. The usage I assume is for one-line scripts. (i.e. dotfiles or some install scripts, like curl https://example.com | sh)

If you access from browsers, you'll redirected to the GitHub page, not a raw file.

For the development or testing, you can access to the different branches or tags. To do this, simply add the ref name to the sub-directory. (i.e. curl https://example.com/ref | sh)



📊 Usage

💻 On Local

  1. Copy the .env.tmpl to .env and edit as you prefer

    🌍 Environment Variables

  2. Follow the steps depending on the runtime

    • 🦕 Deno

      1. Run this command

        deno serve -A --env-file='.env' jsr:@5ouma/reproxy
        
    • 🍞 Bun

      1. Add this code to the index.ts

        export { default } from "@5ouma/reproxy";
        
      2. Run these commands

        bunx jsr add @5ouma/reproxy
        bun run index.ts
        
    • 🐢 Node.js

      1. Add this code to the index.js

        import { serve } from "@hono/node-server";
        import app from "@5ouma/reproxy";
        serve(app);
        
      2. Run these commands

        npm install @hono/node-server
        npx jsr add @5ouma/reproxy
        node run index.js
        

🦕 Use Deno Deploy

  1. Create a new playground

  2. Replace the default code with this

    export { default } from "jsr:@5ouma/reproxy";
    
  3. Set the environment variables (Don't forget!!)

    🌍 Environment Variables


⛅️ Use Cloudflare Workers

  1. Set up the wrangler.toml

    🌍 Environment Variables

  2. Add this code to the index.ts

    export { default } from "@5ouma/reproxy";
    
  3. Deploy with these commands

    npx jsr add @5ouma/reproxy
    npx wrangler deploy index.ts
    



🔨 Development

  1. Clone this repository

    git clone https://github.com/5ouma/reproxy.git
    
  2. Copy the .env.tmpl to .env and edit as you prefer

    🌍 Environment Variables

  3. Run the server.ts via these task runners

    # For production
    deno task start
    
    # For development
    deno task dev
    



🌍 Environment Variables

Name Required
REPOSITORY_OWNER yes
REPOSITORY_NAME yes
REPOSITORY_PATH yes
GITHUB_TOKEN no
Note

You need to add GITHUB_TOKEN if you want to:

  • Access the file in the private repository
  • Avoid the API usage limit



🆘 Help



🎽 Contributing

I happily welcome your contributions! Before you contribute, I would recommend reading CONTRIBUTING.md for a better development experience.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@5ouma/reproxy

Import symbol

import * as reproxy from "@5ouma/reproxy";
or

Import directly with a jsr specifier

import * as reproxy from "jsr:@5ouma/reproxy";

Add Package

pnpm i jsr:@5ouma/reproxy
or (using pnpm 10.8 or older)
pnpm dlx jsr add @5ouma/reproxy

Import symbol

import * as reproxy from "@5ouma/reproxy";

Add Package

yarn add jsr:@5ouma/reproxy
or (using Yarn 4.8 or older)
yarn dlx jsr add @5ouma/reproxy

Import symbol

import * as reproxy from "@5ouma/reproxy";

Add Package

vlt install jsr:@5ouma/reproxy

Import symbol

import * as reproxy from "@5ouma/reproxy";

Add Package

npx jsr add @5ouma/reproxy

Import symbol

import * as reproxy from "@5ouma/reproxy";

Add Package

bunx jsr add @5ouma/reproxy

Import symbol

import * as reproxy from "@5ouma/reproxy";