Comments (6)
I'm not clear what the usecase is for this format. the data for a given repo all comes back at once, so there's nothing to stream. We could stream results by repo in an org, but that would be a separate return format.
Or are we talking about the output being fed into a stream? It would be simple enough to take all the extra space out of the JSON printed to the console and add a newline at the end.
--flat
would indicate something entirely different to me, some kind of denesting of data. Maybe we want to go with --nd
or something like that.
from name-your-contributors.
Fair point. This may already solve @diasdavid's needs, then. I'll point him here and ask.
from name-your-contributors.
An ndjson stream of documents would be 👌🏽 Thanks for considering adding this feature, @RichardLitt :)
from name-your-contributors.
@diasdavid Can you clarify - Is the only difference a one-line JSON object with a newline at the end?
from name-your-contributors.
ndjson are "new-line separated JSON objects" and the beauty of it is that lets you pipe a stream of JSON objects and start parsing them as soon as they are ready. It is also a way of sharding a very large JSON blob into smaller units that are more manageable.
from name-your-contributors.
Thanks for clarifying @diasdavid. I get what ndjson is, my question is more how this tool is to be used.
Envisaged use case 1: script is called via a batch script and the individual results streamed out as ndjson. Something like
for REPO in `cat repo-list.txt`
do
name-your-contributors --user $ME --repo $REPO --ndjson > {STREAM_SOCKET}
done
Possible use case 2: the --org
option, instead of returning a single JSON array, returns an ndjson stream. This would only be for the convenience of the caller I believe, since in my testing I've exhausted the GitHub rate limit with all query results in memory and it wasn't a problem. Maybe on a very small box, like an ec2 micro, it would be.
Use case 2 would be a bad idea probably. We're not streaming on the inside and I don't see us rewritting the script from the ground up to do so, so the script will be the bottleneck: it won't return the first NDJSON object until it's ready to return them all. So overall I think it will slow things down for the consumer, or be a wash at best.
As far as JSON documents go we're not returning much, so parsing shouldn't be a bottleneck.
from name-your-contributors.
Related Issues (20)
- engine warning HOT 1
- Status indication HOT 2
- note first-time contributors
- Get email for users HOT 4
- Document Development features HOT 1
- Add a Cache HOT 2
- Add more examples to the README
- Error: "Your token has not been granted the required scopes to execute this query" HOT 3
- Publish HOT 11
- CSV format doesn't show commits
- Org flag raises GraphQL permissions error HOT 4
- Get emails for users HOT 6
- The automated release is failing 🚨 HOT 1
- Version 10 of node.js has been released HOT 2
- An in-range update of travis-deploy-once is breaking the build 🚨 HOT 5
- 'Cannot find module' error HOT 2
- Before and after need to be specified when requiring HOT 8
- The automated release is failing 🚨 HOT 3
- Disable semantic-release HOT 4
- commitComments and commitcomments in --full json HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from name-your-contributors.