Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ModuleOne = require('./moduleone');
- var ModuleTwo = require('./moduletwo');
- function dataQuery() {
- this.query = function(text, callback) {
- //...//
- }
- };
- module.exports = dataQuery;
- var dataQuery = require('./dataquery.js');
- function query() {
- var dq = new dataQuery();
- dq.query('interesting data', function(json){
- console.log("query response: " + json);
- });
- }
- query();
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Data Query</title>
- <script src="dataquery-bundle.js" type="text/javascript"></script>
- </head>
- <body>
- <script src="dataapp.js" type="text/javascript"></script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment