Cuillere
CuillereJS is an extensible asynchronous execution framework based on generator functions.
Install / Use
/learn @cuillerejs/CuillereREADME
CuillereJS is an extensible asynchronous execution framework based on generator functions.
🚧 CuillereJS is still experimental, APIs may change at any time.
Why ?
The goal of CuillereJS is to abstract some inevitable technical complexity (such as managing database transactions) in plugins, and keep business code as simple and focused as possible.
Usage
In this example we use CuillereJS to manage the connection to a PostgreSQL database.
const cuillere = require('@cuillere/core')
const { poolPlugin, transactionPlugin, queryPlugin } = require('@cuillere/postgres')
const cllr = cuillere(
poolPlugin({ /* postgres config */ }), // Manages connection pool
transactionPlugin(), // Manages transactions
queryPlugin() // Executes queries
)
const addUserAddress = (userId, address, setDefault) => cllr.call(function*() {
const res = yield query({
text: `INSERT INTO addresses (userId, street, postalcode, city)
VALUES ($1, $2, $3, $4)
RETURNING *`,
values: [userId, address.street, address.postalCode, address.city]
})
if (setDefault) {
const addressId = res.rows[0].id
yield query({
text: `UPDATE users
SET defaultaddressid = $1
WHERE userid = $2`,
values: [addressId, userId]
})
}
})
Install
yarn add @cuillere/core
Authors
👤 Valentin Cocaud
- Twitter: @ragorn44
- Github: @EmrysMyrddin
👤 Nicolas Lepage
- Twitter: @njblepage
- Github: @nlepage
🤝 Contributing
Contributions, issues and feature requests are welcome!<br />Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2020 CuillereJS.<br /> This project is Apache-2.0 licensed.
This README was generated with ❤️ by readme-md-generator
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.5kCommit, push, and open a PR
