Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONstat() #9

Closed
evenstensberg opened this issue Aug 18, 2016 · 5 comments
Closed

JSONstat() #9

evenstensberg opened this issue Aug 18, 2016 · 5 comments

Comments

@evenstensberg
Copy link

Hi! Dunno if this is just me being dumb with stat, or if this is an error, but I've imported the module from npm, and tried to find values when retrieving the url.

Could you elaborate?

skjermbilde 2016-08-18 kl 20 42 22
skjermbilde 2016-08-18 kl 20 43 57

@badosa
Copy link
Owner

badosa commented Aug 18, 2016

The JSONstat Javascript Toolkit includes a simple XHR implementation (sync and async). It is not recommended to use such simple implementation in production and it is provided mainly for testing purposes.

The JSONstat module does not include such XHR implementation because node.js already comes with a built-in http module and many third-party modules already try to simplify such task (like request or got).

It is not you being dumb: it's bad documentation (my fault). This limitation is mentioned in the wiki under Installation (probably an unexpected place):

https://github.com/badosa/JSON-stat/wiki/Installation

but not on NPM (that imports the JJT readme file from GitHub and it's not module-specific).

This module has all the functionality of the client version except the connection capabilities (JSONstat accepts only a JSON-stat response object, not a URI string). Use Node.js’s built-in http module, or a module with a similar functionality (like got) to retrieve a remote JSON-stat response. See nodejs.js or our Tonic + npm code as an example.

@badosa badosa closed this as completed Aug 18, 2016
@evenstensberg
Copy link
Author

Yeah! Figured it out eventually! Would be nice of some example repos, not just <script> tags in an html :) also, an polyfill with fetch so you could call response.jsonStat() would be awesome!

@badosa
Copy link
Owner

badosa commented Sep 1, 2016

The Readme file and the API reference have been edited to reflect the module limitations. Changes won't show on NPM until a new version is published.

@evenstensberg
Copy link
Author

Awesome, keep up the good work. This library has potential :)

@evenstensberg
Copy link
Author

Let me know if you want some help on documentation and examples with other libraries 📫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants