Question

I'm sure I'm doing something stupid, but I can't get node-fnoc to work. I have a directory with a simple package.json in it, I have a /config/ directory in that directory with a simple JSON file in it. And, I'm basically just trying to do what they have in their example.

var fnoc = require('fnoc');

fnoc(function(err, configs){    
  console.log(configs); 
});

and this is what I'm getting:

fnoc(function(err, configs){
^
TypeError: object is not a function
    at Object.<anonymous> (/opt/backups/readconfig.js:3:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

Any ideas?

Was it helpful?

Solution

The document on github is for version 0.2.2

You need to install fnoc@0.2.2

npm install fnoc@0.2.2

Run your js

node your.js

Output:

{ package:
   { name: 'asdf',
      dependencies:
      { express: '*',
        jade: '*',

Version is in the changelog file:

https://github.com/jprichardson/node-fnoc/blob/master/CHANGELOG.md

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top