Package Exports
- @iridium/use-knex
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@iridium/use-knex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Use-knex
Usage:
const knex = require('@iridium/use-knex');
const config = {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test'
}
};
const useKnex = knex(config)
// function serverless
module.exports = useKnex(async (req, res) => {
const users = await req
.db
.select('*')
.from('users'); // <- Thanks to use-knex;
res.end();
})
License
MIT © David Bernal