• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. BobSpero
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    BobSpero

    @BobSpero

    0
    Reputation
    259
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    BobSpero Unfollow Follow

    Latest posts made by BobSpero

    • RE: Can I use readFile to set properties for my App ?

      I got it, thanks!

      posted in NodeBB Development
      BobSpero
      BobSpero
    • Can I use readFile to set properties for my App ?

      I do not know if I am asking the right question in the right group or what, but I can use some help here. I am trying to build a node.js application having the node oracle module. I want to read the raw sql files on my server side and use them in my connection.execute(select.toString(), [], function(err, results) function. So to test it I create a var and did select * from inventory and it works as anticipated. So now I figure why retype just read my sql files and if I want to make changes I just change the sql file. Below is my code, how the heck do I get these in my select var. I have been told to use readFileSync but I read you should not use that on the server side. And yes I am new, just about four days with node.

      foo.js

      var fs = require('fs');
      
      function sql_file(sql_file, cb) {
          console.log('about to read file');
          var fileName = "./SQLs/" + sql_file;
          fs.readFile(fileName, function(err, buffer) {
              console.log('the file has been read');
              if (err) return cb(err);
              return cb(null, buffer.toString());
          });
          console.log('call to read file made (but not finished)');
      }
          
      sql_file('inventory.sql', function(err, contents) {
          console.log(contents.toString());
      });
      
      module.exports.sql_file = sql_file;
      
      posted in NodeBB Development
      BobSpero
      BobSpero

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact