- v4.1.56Latest
- v4.1.55
- v4.1.54
- v4.1.53
- v4.1.52
- v4.1.51
- v4.1.50
- v4.1.49
- v4.1.48
- v4.1.47
- v4.1.46
- v4.1.45
- v4.1.44
- v4.1.43
- v4.1.42
- v4.1.41
- v4.1.40
- v4.1.39
- v4.1.37
- v4.1.36
- v4.1.35
- v4.1.34
- v4.1.33
- v4.1.32
- v4.1.31
- v4.1.30
- v4.1.29
- v4.1.28
- v4.1.27
- v4.1.26
- v4.1.25
- v4.1.24
- v4.1.23
- v4.1.22
- v4.1.21
- v4.1.20
- v4.1.19
- v4.1.18
- v4.1.17
- v4.1.16
- v4.1.15
- v4.1.14
- v4.1.13
- v4.1.12
- v4.1.11
- v4.1.10
- v4.1.9
- v4.1.8
- vUnreleased
- v4.1.7
- v4.1.6
- v4.1.5
- v4.1.4
- v4.1.3
- v4.1.2
- 0.7.20
- 0.7.15
- 0.7.13
- 0.7.12
- 0.7.11
- 0.7.9
- 0.7.8
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
β Intro
βοΈ cool is an ecosystem designed to promote best practices, a specific philosophy, and enhanced portability across different platforms.
It is comprised of various sub-components, each designed to work harmoniously together, allowing developers to abstract their code for better portability across different platforms. This encourages a functional programming approach, enabling code to be written once and then run on various mainstream environments such as CLI, bot platforms, cloud-function runtimes, and web APIs.
The reason we started to build this project is the feeling of a lack of a JavaScript/TypeScript framework that is portable across web browsers, Deno, Supabase, Netlify, AWS Lambda, and Cloudflare Workers. By adhering to WinterCG guidelines and TC39 standards, we aim to provide a framework that is portable across all these platforms.
Sample (WIP)
import { Runtime, Context } from "$cool/runtime/mod.ts";
const fn = (ctx: Context) => {
const name = ctx.input.get("name");
const db = ctx.di`db`;
ctx.logger.info(`Hello ${name}!`);
return ctx.results.json(db.query("SELECT * FROM users"));
};
const router = (ctx: Context) => {
const path = ctx.input.get("path");
switch (path) {
case "/":
return fn(ctx);
default:
return ctx.results.notFound();
}
};
const runtime = new Runtime();
runtime.ci.register("db", new DatabaseConnection());
runtime.listen(router); // or runtime.execute(fn);π Components
| Component | Area | Description |
|---|---|---|
| π cool/directives | Rules | The ground rules adhered to by the entire ecosystem |
| π cool/standards | Abstraction | |
| βοΈ cool/di | Manager | Dependency injection container |
| π§± cool/fp | Functions Library | Tools for functional programming |
| π cool/dotenv | Manager | Load configurations from environment |
See the respective component page to figure out its specific usage.
π Jumpstart
Ensure that Deno 1.36 or higher is installed on your system first.
Install cool cli globally first, then create a new project:
$ deno install -A -n cool https://c00l.deno.dev
$ cool create my-cool-project
Creating "cool web project template 0.0.1" on my-cool-project...
...
done.π FAQ
Want to report a bug or request a feature?
Please read through our CONTRIBUTING.md and report it using GitHub Issues!
Want to contribute?
It is publicly open for any contribution. Bug fixes, new features and additional components are welcome.
If youβre not sure where to start, check out the issues labeled
good first issue and help wanted. We also recommend looking at closed ones
to get a sense of the kinds of issues you can tackle.
To contribute, fork the repo, push your changes to your fork, and then submit a pull request.
Requirements
- Deno 1.36 or higher (https://deno.land/)
License
Apache 2.0, for further details, please see LICENSE file.
To Support
Visit my GitHub Sponsors profile at github.com/sponsors/eser