├── .gitignore ├── README.md ├── app.js ├── index.html ├── jsonql.png ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jsonQL 2 | 3 | With ST, you ccan parse any JSON object with a template to create a new JSON. 4 | 5 | The powerful thing here is that even the template itself is also written in JSON. 6 | 7 | This lets you do all kinds of cool things, such as using it as a JSON payload for a web request. 8 | 9 | ## Usage 10 | 11 | Install dependencies, and then run. 12 | 13 | ``` 14 | $ npm install 15 | $ npm start 16 | ``` 17 | 18 | It will start an `express.js` server and display the following message in the console: 19 | 20 | ``` 21 | Listening! 22 | ``` 23 | 24 | Now open your browser at `http://localhost:3000` and you'll see: 25 | 26 | ![jsonql](./jsonql.png) 27 | 28 | Try pressing "submit". This will: 29 | 30 | 1. Send a **POST** request to `http://localhost:3000/query` endpoint with the JSON payload. 31 | 2. The express server will use that template to transform its data and return result 32 | 3. The fetch handler will update the bottom textarea with the response. You can try changing the query JSON from the top editor to get different results. 33 | 34 | 35 | ## How it works 36 | 37 | This example demonstrates how you can use ST to write a "JSON QL". No complicated implementation is necessary because it's all pure JSON. Here's how it works: 38 | 39 | ### 1. Find out the server's data structure. 40 | 41 | For example, let's say the server has an object called `db` in memory: 42 | 43 | ``` 44 | db = { 45 | users: [{ 46 | "user_id": 1, "title": "hello world", "content": "just setting up my blog", "created_at": 1505777155159 47 | }, { 48 | "user_id": 1, "title": "post2", "content": "second post", "created_at": 1505756257359 49 | }, { 50 | "user_id": 2, "title": "cool", "content": "cool blog bro", "created_at": 1504777258259 51 | }, { 52 | "user_id": 3, "title": "im here", "content": "im here too, welcome me", "created_at": 1503777259159 53 | }] 54 | } 55 | ``` 56 | 57 | ### 2. Write a JSON query language in ST template format 58 | 59 | To query above object we construct a JSON template from the client side. Here's what it looks like: 60 | 61 | ``` 62 | { 63 | "users": { 64 | "{{#each users}}": { 65 | "id": "{{user_id}}", 66 | "post": { 67 | "title": "{{title}}", 68 | "content": "{{content}}" 69 | } 70 | } 71 | } 72 | } 73 | ``` 74 | 75 | ### 3. Send the JSONQL as payload 76 | 77 | That's it! This is literally all you need to do. Send it over web request to your endpoint: 78 | 79 | ``` 80 | fetch(this._endpoint, { 81 | method: "POST", 82 | headers: { 83 | 'Accept': 'application/json', 84 | 'Content-Type': 'application/json' 85 | }, 86 | body: JSON.stringify({ 87 | "users": { 88 | "{{#each users}}": { 89 | "id": "{{user_id}}", 90 | "post": { 91 | "title": "{{title}}", 92 | "content": "{{content}}" 93 | } 94 | } 95 | } 96 | }) 97 | }) 98 | .then(function(res) { 99 | return res.json(); 100 | }) 101 | .then(function(res) { 102 | console.log("Response: ", res); 103 | }) 104 | ``` 105 | 106 | ### 4. The server translates JSONQL simply by running a transform on its database. 107 | 108 | In this example we use a simple `express.js` server to listen to `POST` request 109 | 110 | ``` 111 | app.post('/query', function(req, res){ 112 | let jsonql = req.body; 113 | let response = ST.select(jsonql) 114 | .transform(db) 115 | .root(); 116 | res.json(response); 117 | }); 118 | ``` 119 | 120 | Notice how all it's doing is taking the request JSON and using it as a transformer object to transform the `db` object in memory. 121 | 122 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | // Send a request as JSON template, and receive the result 2 | const express = require('express') 3 | const bodyParser = require('body-parser') 4 | const ST = require('stjs') 5 | const app = express() 6 | const chalk = require('chalk'); 7 | const db = { 8 | users: [{ 9 | "user_id": 1, "title": "hello world", "content": "just setting up my blog", "created_at": 1505777155159 10 | }, { 11 | "user_id": 1, "title": "post2", "content": "second post", "created_at": 1505756257359 12 | }, { 13 | "user_id": 2, "title": "cool", "content": "cool blog bro", "created_at": 1504777258259 14 | }, { 15 | "user_id": 3, "title": "im here", "content": "im here too, welcome me", "created_at": 1503777259159 16 | }] 17 | } 18 | app.use(bodyParser.urlencoded({ extended: false })) 19 | app.use(bodyParser.json()) 20 | app.use(express.static('.')) 21 | app.use(function(req, res, next) { 22 | res.header("Access-Control-Allow-Origin", "*"); 23 | res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); 24 | next(); 25 | }); 26 | app.post('/query', function(req, res){ 27 | let jsonql = req.body; 28 | console.log(chalk.yellow("####################\n> Request: "), JSON.stringify(jsonql, null, 2)); 29 | let response = ST.select(jsonql) 30 | .transform(db) 31 | .root(); 32 | 33 | console.log(chalk.green("< Response: "), JSON.stringify(response, null, 2)); 34 | res.json(response); 35 | }); 36 | app.listen(process.env.PORT || 3000, function () { console.log(chalk.green('Express server started... Listening at http://localhost:3000!')) }) 37 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 161 | 162 | -------------------------------------------------------------------------------- /jsonql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SelectTransform/JSONQL/8b31c22cb1ae3ce107493e51a626935e4b50a83e/jsonql.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonql", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.4", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", 10 | "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", 11 | "requires": { 12 | "mime-types": "2.1.17", 13 | "negotiator": "0.6.1" 14 | } 15 | }, 16 | "ansi-styles": { 17 | "version": "3.2.0", 18 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", 19 | "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", 20 | "requires": { 21 | "color-convert": "1.9.0" 22 | } 23 | }, 24 | "array-flatten": { 25 | "version": "1.1.1", 26 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 27 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 28 | }, 29 | "body-parser": { 30 | "version": "1.18.2", 31 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", 32 | "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", 33 | "requires": { 34 | "bytes": "3.0.0", 35 | "content-type": "1.0.4", 36 | "debug": "2.6.9", 37 | "depd": "1.1.1", 38 | "http-errors": "1.6.2", 39 | "iconv-lite": "0.4.19", 40 | "on-finished": "2.3.0", 41 | "qs": "6.5.1", 42 | "raw-body": "2.3.2", 43 | "type-is": "1.6.15" 44 | } 45 | }, 46 | "bytes": { 47 | "version": "3.0.0", 48 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", 49 | "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" 50 | }, 51 | "chalk": { 52 | "version": "2.3.0", 53 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", 54 | "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", 55 | "requires": { 56 | "ansi-styles": "3.2.0", 57 | "escape-string-regexp": "1.0.5", 58 | "supports-color": "4.5.0" 59 | } 60 | }, 61 | "color-convert": { 62 | "version": "1.9.0", 63 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", 64 | "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", 65 | "requires": { 66 | "color-name": "1.1.3" 67 | } 68 | }, 69 | "color-name": { 70 | "version": "1.1.3", 71 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 72 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 73 | }, 74 | "content-disposition": { 75 | "version": "0.5.2", 76 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", 77 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 78 | }, 79 | "content-type": { 80 | "version": "1.0.4", 81 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 82 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 83 | }, 84 | "cookie": { 85 | "version": "0.3.1", 86 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", 87 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 88 | }, 89 | "cookie-signature": { 90 | "version": "1.0.6", 91 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 92 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 93 | }, 94 | "debug": { 95 | "version": "2.6.9", 96 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 97 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 98 | "requires": { 99 | "ms": "2.0.0" 100 | } 101 | }, 102 | "depd": { 103 | "version": "1.1.1", 104 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", 105 | "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" 106 | }, 107 | "destroy": { 108 | "version": "1.0.4", 109 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 110 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 111 | }, 112 | "ee-first": { 113 | "version": "1.1.1", 114 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 115 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 116 | }, 117 | "encodeurl": { 118 | "version": "1.0.1", 119 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", 120 | "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" 121 | }, 122 | "escape-html": { 123 | "version": "1.0.3", 124 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 125 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 126 | }, 127 | "escape-string-regexp": { 128 | "version": "1.0.5", 129 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 130 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 131 | }, 132 | "etag": { 133 | "version": "1.8.1", 134 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 135 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 136 | }, 137 | "express": { 138 | "version": "4.16.2", 139 | "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", 140 | "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", 141 | "requires": { 142 | "accepts": "1.3.4", 143 | "array-flatten": "1.1.1", 144 | "body-parser": "1.18.2", 145 | "content-disposition": "0.5.2", 146 | "content-type": "1.0.4", 147 | "cookie": "0.3.1", 148 | "cookie-signature": "1.0.6", 149 | "debug": "2.6.9", 150 | "depd": "1.1.1", 151 | "encodeurl": "1.0.1", 152 | "escape-html": "1.0.3", 153 | "etag": "1.8.1", 154 | "finalhandler": "1.1.0", 155 | "fresh": "0.5.2", 156 | "merge-descriptors": "1.0.1", 157 | "methods": "1.1.2", 158 | "on-finished": "2.3.0", 159 | "parseurl": "1.3.2", 160 | "path-to-regexp": "0.1.7", 161 | "proxy-addr": "2.0.2", 162 | "qs": "6.5.1", 163 | "range-parser": "1.2.0", 164 | "safe-buffer": "5.1.1", 165 | "send": "0.16.1", 166 | "serve-static": "1.13.1", 167 | "setprototypeof": "1.1.0", 168 | "statuses": "1.3.1", 169 | "type-is": "1.6.15", 170 | "utils-merge": "1.0.1", 171 | "vary": "1.1.2" 172 | }, 173 | "dependencies": { 174 | "setprototypeof": { 175 | "version": "1.1.0", 176 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 177 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 178 | }, 179 | "statuses": { 180 | "version": "1.3.1", 181 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", 182 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 183 | } 184 | } 185 | }, 186 | "finalhandler": { 187 | "version": "1.1.0", 188 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", 189 | "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", 190 | "requires": { 191 | "debug": "2.6.9", 192 | "encodeurl": "1.0.1", 193 | "escape-html": "1.0.3", 194 | "on-finished": "2.3.0", 195 | "parseurl": "1.3.2", 196 | "statuses": "1.3.1", 197 | "unpipe": "1.0.0" 198 | }, 199 | "dependencies": { 200 | "statuses": { 201 | "version": "1.3.1", 202 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", 203 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 204 | } 205 | } 206 | }, 207 | "forwarded": { 208 | "version": "0.1.2", 209 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 210 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 211 | }, 212 | "fresh": { 213 | "version": "0.5.2", 214 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 215 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 216 | }, 217 | "has-flag": { 218 | "version": "2.0.0", 219 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", 220 | "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" 221 | }, 222 | "http-errors": { 223 | "version": "1.6.2", 224 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 225 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 226 | "requires": { 227 | "depd": "1.1.1", 228 | "inherits": "2.0.3", 229 | "setprototypeof": "1.0.3", 230 | "statuses": "1.4.0" 231 | } 232 | }, 233 | "iconv-lite": { 234 | "version": "0.4.19", 235 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 236 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 237 | }, 238 | "inherits": { 239 | "version": "2.0.3", 240 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 241 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 242 | }, 243 | "ipaddr.js": { 244 | "version": "1.5.2", 245 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", 246 | "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" 247 | }, 248 | "media-typer": { 249 | "version": "0.3.0", 250 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 251 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 252 | }, 253 | "merge-descriptors": { 254 | "version": "1.0.1", 255 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 256 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 257 | }, 258 | "methods": { 259 | "version": "1.1.2", 260 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 261 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 262 | }, 263 | "mime": { 264 | "version": "1.4.1", 265 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", 266 | "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" 267 | }, 268 | "mime-db": { 269 | "version": "1.30.0", 270 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", 271 | "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" 272 | }, 273 | "mime-types": { 274 | "version": "2.1.17", 275 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", 276 | "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", 277 | "requires": { 278 | "mime-db": "1.30.0" 279 | } 280 | }, 281 | "ms": { 282 | "version": "2.0.0", 283 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 284 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 285 | }, 286 | "negotiator": { 287 | "version": "0.6.1", 288 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 289 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 290 | }, 291 | "on-finished": { 292 | "version": "2.3.0", 293 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 294 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 295 | "requires": { 296 | "ee-first": "1.1.1" 297 | } 298 | }, 299 | "parseurl": { 300 | "version": "1.3.2", 301 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 302 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 303 | }, 304 | "path-to-regexp": { 305 | "version": "0.1.7", 306 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 307 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 308 | }, 309 | "proxy-addr": { 310 | "version": "2.0.2", 311 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", 312 | "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", 313 | "requires": { 314 | "forwarded": "0.1.2", 315 | "ipaddr.js": "1.5.2" 316 | } 317 | }, 318 | "qs": { 319 | "version": "6.5.1", 320 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", 321 | "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" 322 | }, 323 | "range-parser": { 324 | "version": "1.2.0", 325 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 326 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 327 | }, 328 | "raw-body": { 329 | "version": "2.3.2", 330 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", 331 | "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", 332 | "requires": { 333 | "bytes": "3.0.0", 334 | "http-errors": "1.6.2", 335 | "iconv-lite": "0.4.19", 336 | "unpipe": "1.0.0" 337 | } 338 | }, 339 | "safe-buffer": { 340 | "version": "5.1.1", 341 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 342 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 343 | }, 344 | "send": { 345 | "version": "0.16.1", 346 | "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", 347 | "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", 348 | "requires": { 349 | "debug": "2.6.9", 350 | "depd": "1.1.1", 351 | "destroy": "1.0.4", 352 | "encodeurl": "1.0.1", 353 | "escape-html": "1.0.3", 354 | "etag": "1.8.1", 355 | "fresh": "0.5.2", 356 | "http-errors": "1.6.2", 357 | "mime": "1.4.1", 358 | "ms": "2.0.0", 359 | "on-finished": "2.3.0", 360 | "range-parser": "1.2.0", 361 | "statuses": "1.3.1" 362 | }, 363 | "dependencies": { 364 | "statuses": { 365 | "version": "1.3.1", 366 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", 367 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 368 | } 369 | } 370 | }, 371 | "serve-static": { 372 | "version": "1.13.1", 373 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", 374 | "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", 375 | "requires": { 376 | "encodeurl": "1.0.1", 377 | "escape-html": "1.0.3", 378 | "parseurl": "1.3.2", 379 | "send": "0.16.1" 380 | } 381 | }, 382 | "setprototypeof": { 383 | "version": "1.0.3", 384 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 385 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 386 | }, 387 | "statuses": { 388 | "version": "1.4.0", 389 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 390 | "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" 391 | }, 392 | "stjs": { 393 | "version": "0.0.4", 394 | "resolved": "https://registry.npmjs.org/stjs/-/stjs-0.0.4.tgz", 395 | "integrity": "sha512-S9qkfRxR+piBvmHdOFJUBDkLpVU4SBVzSN9ng0wUPNUaNsv2WgeT1SYqkks4Uf2VdyZbukjtNbM7hTiGl6iPFQ==" 396 | }, 397 | "supports-color": { 398 | "version": "4.5.0", 399 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", 400 | "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", 401 | "requires": { 402 | "has-flag": "2.0.0" 403 | } 404 | }, 405 | "type-is": { 406 | "version": "1.6.15", 407 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", 408 | "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", 409 | "requires": { 410 | "media-typer": "0.3.0", 411 | "mime-types": "2.1.17" 412 | } 413 | }, 414 | "unpipe": { 415 | "version": "1.0.0", 416 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 417 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 418 | }, 419 | "utils-merge": { 420 | "version": "1.0.1", 421 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 422 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 423 | }, 424 | "vary": { 425 | "version": "1.1.2", 426 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 427 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 428 | } 429 | } 430 | } 431 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonql", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "node app" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "body-parser": "^1.18.2", 13 | "chalk": "^2.3.0", 14 | "express": "^4.16.2", 15 | "stjs": "0.0.4" 16 | } 17 | } 18 | --------------------------------------------------------------------------------