loadsql
Installation
npm install loadsql --save
Usage
Synchronous loading
const loader = const data = loader console // SELECT ?? FROM ?? WHERE ?? = ?
Asynchronous loading using callbacks
const loader = loader
Asynchronous loading using promises
npm install bluebird --save
SQLLoaderPromise = Promise const loader = loader
Custom base path and file extension
Examples above create instances of SQLLoader
that
- will use the default
path.resolve()
base path. - will use the default
.sql
file extension.
You can set your own base path and extension as follows:
const basePath = pathconst ext = '.tpl'const loader = basePath ext
License
The project is licensed under the MIT license.