cloudworker-tls-no-crypto
This repo is based on @supermari0's repo, which is based on @dollarshaveclub's repo.
Cloudworker allows you to run Cloudflare Worker scripts locally.
Installing
Install via NPM:
npm install -g cloudworker-tls-no-crypto
Package Usage
const Cloudworker = const simpleScript = `addEventListener('fetch', event => { event.respondWith(new Response('hello', { status: 200 }))})` const req = 'https://myfancywebsite.com/someurl'const cw = simpleScriptcw
CLI Usage
Usage: cloudworker [options] <file> Options: -p, --port <port> Port -d, --debug Debug -s, --kv-set [variable.key=value] Binds variable to a local implementation of Workers KV and sets key to value -f, --kv-file [variable=path] Set the filepath
Simple
cloudworker example/example.jscurl localhost:3000/
cloudworker --debug example/example.jscurl localhost:3000/
Workers KV
cloudworker --debug --kv-set KeyValueStore.key=value --kv-set KeyValueStore.hello=world example/example-kv.jscurl localhost:3000/
Workers KV with Persistence
cloudworker --debug --kv-file KeyValueStore=kv.json --kv-set KeyValueStore.key=value --kv-set KeyValueStore.hello=world example/example-kv.jscurl localhost:3000/
WebAssembly
Simple
cloudworker --debug --wasm Wasm=example/simple.wasm example/example-wasm-simple.jscurl localhost:3000/
Inverse Square Root
cloudworker --debug --wasm isqrt=example/isqrt.wasm example/example-wasm-isqrt.jscurl localhost:3000/?num=9
Resizer
cloudworker --debug --wasm RESIZER_WASM=example/resizer.wasm example/example-wasm-resizer.jscurl localhost:3000/wasm-demo/dogdrone.png?width=210 # or open in browser
License
MIT