This package has been deprecated

Author message:

please use from GitHub directly

jsyesql

1.4.0 • Public • Published

jsyesql

NPM Package Build Status

js-standard-style

JavaScript + Yesql

Inspired by goyesql

Parse text and associate SQL queries to a Object. Useful for separating SQL from code logic.

Usage

const fs = require('fs')
const jsyesql = require('jsyesql')
 
/*
queries.sql:
-- name: selectAll
SELECT * FROM table_name; -- comment
*/
 
const queries = jsyesql.parseText(fs.readFileSync('./queries.sql', 'utf8'))
console.log(queries.selectAll)
// SELECT * FROM table_name;

LICENSE

This library is free and open-source software released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i jsyesql

Weekly Downloads

61

Version

1.4.0

License

MIT

Unpacked Size

4.49 kB

Total Files

4

Last publish

Collaborators

  • fanatid