https://github.com/architect/functions-deno
https://github.com/architect/functions-deno
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/architect/functions-deno
- Owner: architect
- License: apache-2.0
- Created: 2021-05-27T20:38:30.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-31T19:25:36.000Z (about 5 years ago)
- Last Synced: 2025-04-14T18:59:42.550Z (about 1 year ago)
- Language: JavaScript
- Size: 1.58 MB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- Contributing: .github/contributing.md
- License: LICENSE
- Code of conduct: .github/code_of_conduct.md
Awesome Lists containing this project
README
[
](https://www.npmjs.com/package/@architect/functions)
## Deno @architect-functions
> Runtime helper library for serverless apps built with [Architect][Deno]
## Example
# Http async
```javascript
import arc from 'https://raw.githubusercontent.com/architect/functions-deno/main/src/index.js'
export const handler = arc.http.async( (event: Record) => {
console.log(JSON.stringify(event, null, 2));
return {
location: "/"
}
});
```
# Auth
- I've updated the arc-example-login-flow example to the Deno runtime
https://github.com/hicksy/deno-arc-example-login-flow
# Test
Integration only:
`deno test --allow-run --allow-read --allow-env --allow-write --allow-net --unstable ./test/integration`
Unit only:
`deno test --allow-run --allow-read --allow-env --allow-write --allow-net --unstable ./test/unit`
# Notes
- `Deno.run` use to launch a sub process of `arc sandbox` within the mock path - not possible to directly call sandbox through JS
- Having to use `sanitizeResources: false,sanitizeOps: false` on `Deno.test` quite a bit - does this suggest a problem in the codebase / the tests / or is this safe?
## Todo
- unexpress (src/https/express)
- JWE - *_Session tokens incompatible with node/ruby/python_* - currently there's no availaility of a library that uses the A128GCM algorithm. Possible that if [webcrypto APIs are implemented in Deno](https://github.com/denoland/deno/issues/1891) then [jose](https://github.com/panva/jose) would be available.
- no zlib. `compress.js` uses `gzipDecode/ gzipEncode`, `deflate/inflate` and `compress/decompress` (brotli) instead
Test with suffix `.test-fail.js` are skipped, we need to refactor based on:
- No `mockfs` equivalant and can't use Skypack / jspm,
- No `proxyquire`