# Local JSON file

**URL:** <https://forums.fusetools.com/t/local-json-file/4655>\
**Category:** How-to Discussions\
**Created:** [July 9, 2016, 7:02pm UTC](https://forums.fusetools.com/t/local-json-file/4655 "2016-07-09T19:02:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [July 9, 2016, 7:02pm UTC](https://forums.fusetools.com/t/local-json-file/4655/1 "2016-07-09T19:02:27Z")

</div>

I tried this method which was on fuse offical document. But it doesn’t work

```auto
  var Bundle = require("FuseJS/Bundle");

  Bundle.read("someData.json")
      .then(function(contents) {
          console.log(contents);
      }, function(error) {
          console.log("Error!", error);
      });

```

SomeData.json file

```auto
  [{
    "list": [
      {
        "Director": "Theresa Carr",
        "Manager": "Peter Morales",
        "Manager1": "Jeffrey Martin",
        "Developer": "Melissa Jackson",
        "Publicrelation": "Robert Cunningham",
        "CommunityManager": "Kelly Rogers"
      }
    ]
  }]

```

it runs on fuse console but there is no output. What I did wrong? any help

---

<div class="post-metadata">

**Author:** ![Edwin\_Reynoso](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@Edwin\_Reynoso](https://forums.fusetools.com/u/Edwin_Reynoso)\
**Post date:** [July 9, 2016, 7:23pm UTC](https://forums.fusetools.com/t/local-json-file/4655/2 "2016-07-09T19:23:50Z")

</div>

Did you actually Bundle your file in your `unoproj` file? [https://www.fusetools.com/docs/fusejs/bundle](https://www.fusetools.com/docs/fusejs/bundle)

```auto
{
    "Includes": [
        "<filename>:Bundle"
    ]
}

```

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [July 9, 2016, 7:25pm UTC](https://forums.fusetools.com/t/local-json-file/4655/3 "2016-07-09T19:25:01Z")

</div>

yup

---

<div class="post-metadata">

**Author:** ![Edwin\_Reynoso](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@Edwin\_Reynoso](https://forums.fusetools.com/u/Edwin_Reynoso)\
**Post date:** [July 9, 2016, 7:36pm UTC](https://forums.fusetools.com/t/local-json-file/4655/4 "2016-07-09T19:36:11Z")

</div>

Make sure to close every fuse instance running and always call `uno clean` after changing your `unoproj` file. Oh and I’m not sure if the naming is case sensitive that could be it. In your JS you did `someData.json` not sure if that’s the same case as the actual file name, also try absolute path names.

Like me I have my json in my Assets folder so:

`Bundle.read('Assets/SomeData.json')`

This forum post should help my last post: [https://www.fusetools.com/community/forums/permalink/7ceb9aea-4b3c-463b-a1f1-9bb5a5e1778b](https://www.fusetools.com/community/forums/permalink/7ceb9aea-4b3c-463b-a1f1-9bb5a5e1778b)

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [July 9, 2016, 9:48pm UTC](https://forums.fusetools.com/t/local-json-file/4655/5 "2016-07-09T21:48:03Z")

</div>

> **Edwin Reynoso wrote:**
> 
> Make sure to close every fuse instance running and always call `uno clean` after changing your `unoproj` file. Oh and I’m not sure if the naming is case sensitive that could be it. In your JS you did `someData.json` not sure if that’s the same case as the actual file name, also try absolute path names.
> 
> Like me I have my json in my Assets folder so:
> 
> `Bundle.read('Assets/SomeData.json')`
> 
> This forum post should help my last post: [https://www.fusetools.com/community/forums/permalink/7ceb9aea-4b3c-463b-a1f1-9bb5a5e1778b](https://www.fusetools.com/community/forums/permalink/7ceb9aea-4b3c-463b-a1f1-9bb5a5e1778b)

Tried the link you provided but still no output. But I keep getting ‘LOG:’ on fuse console.

---

<div class="post-metadata">

**Author:** ![Edwin\_Reynoso](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@Edwin\_Reynoso](https://forums.fusetools.com/u/Edwin_Reynoso)\
**Post date:** [July 9, 2016, 9:50pm UTC](https://forums.fusetools.com/t/local-json-file/4655/6 "2016-07-09T21:50:44Z")

</div>

How are you getting `Log:` if you didn’t show that in your code, did you change your code?

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [July 9, 2016, 9:59pm UTC](https://forums.fusetools.com/t/local-json-file/4655/7 "2016-07-09T21:59:40Z")

</div>

I didn’t change anything I just wrote console.log(people); The output was

```auto
        Log:

```

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [July 10, 2016, 8:03am UTC](https://forums.fusetools.com/t/local-json-file/4655/8 "2016-07-10T08:03:41Z")

</div>

Hi,

`Bundle.read` returns a promise, see here for example: [https://www.fusetools.com/docs/fusejs/bundle/readasync\_95a738ba](https://www.fusetools.com/docs/fusejs/bundle/readasync_95a738ba)

There is also a sync version:

[https://www.fusetools.com/docs/fusejs/bundle/read\_bbef95e2](https://www.fusetools.com/docs/fusejs/bundle/read_bbef95e2)

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [July 10, 2016, 3:03pm UTC](https://forums.fusetools.com/t/local-json-file/4655/9 "2016-07-10T15:03:45Z")

</div>

it’s not reading either. Would be good if working example is provided. If I use Bundle.read(filename). The output is

```auto
    Log:null

```

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [July 10, 2016, 3:50pm UTC](https://forums.fusetools.com/t/local-json-file/4655/10 "2016-07-10T15:50:44Z")

</div>

The example for `read` works for me, exactly as provided in the docs.

Are you sure you have inlcuded your JSON file in the bundle?

Are you sure you understand that `read` is an async method that returns a promise, and does not return the string?

---

<div class="post-metadata">

**Author:** ![Tom1](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@Tom1](https://forums.fusetools.com/u/Tom1)\
**Post date:** [July 10, 2016, 8:26pm UTC](https://forums.fusetools.com/t/local-json-file/4655/11 "2016-07-10T20:26:22Z")

</div>

Ah! the new fresh build works. Have to delete old build and start new build. One question, is fuse planning to use external database like pouchDB, lokijs db or any db?

pouchDB

[https://pouchdb.com/](https://pouchdb.com/)

lokijs db:

[http://lokijs.org/#/](http://lokijs.org/#/)

---

<div class="post-metadata">

**Author:** ![Anders\_Bondehagen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_bondehagen/32/98_2.png) [@Anders\_Bondehagen](https://forums.fusetools.com/u/Anders_Bondehagen)\
**Post date:** [July 11, 2016, 9:23am UTC](https://forums.fusetools.com/t/local-json-file/4655/12 "2016-07-11T09:23:04Z")

</div>

If you are looking after a local DB solution, that is something we really want to do at some point. But there is already one solution created by the community [https://github.com/bolav/fuse-sqlite](https://github.com/bolav/fuse-sqlite)
