cf-workers-deployer
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

cf-workers-deployer

A reverse engineering library that simulates deployment links in Cloudflare Workers Playground.

Installation

# use npm
npm install cf-workers-deployer

# use pnpm
pnpm install cf-workers-deployer

Usage

import { compressFile, getDeployUrl } from 'cf-workers-deployer';

const compressedFiles = compressFile({
    fileData:[
        {
            "name": "index.js", // File Name
            "fileName": "index.js", // File path
            "data": "console.log('Hello World')", // File Data
            "type": "text/javascript" // Content Type
        }
    ],
    mainModule: "index.js" // Main Module file path
})

console.log(compressedFiles) // Returns a string that can be deployed via cloudflare worker playground

const deployUrl = getDeployUrl({fileData:...}) // Returns a deploy url

Features

  • Convert files to strings that can be deployed via cloudflare worker playground
  • Create URL to deploy

Contributing

Reporting Issues

If you find a bug or have a suggestion for improvement:

  1. Check if the issue has already been reported.
  2. If not, create a new issue.
  3. Clearly describe the issue, including steps to reproduce if applicable.

Submitting Pull Requests

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Write or adapt tests as needed.
  5. Run the test suite to ensure everything still passes.
  6. Commit your changes (git commit -am 'Add some feature').
  7. Push to the branch (git push origin feature-branch).
  8. Create a new Pull Request.

Author

License

MIT

Package Sidebar

Install

npm i cf-workers-deployer

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

11.1 kB

Total Files

9

Last publish

Collaborators

  • moons14