npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@samwen/firestore-pagination

v1.0.1

Published

pagination for firebase firestore collection

Downloads

5

Readme

firestore-pagination

how to install

npm install @samwen/firestore-pagination --save

how to use

  1. You will need generate private key under service accounts and save it as serviceAccount.json in the project root folder.

  2. You can use the import-json.js to import books.json into your firestore database.

    node import-json.js books.json

  3. Copy/paste config file as config.js.

  4. demo.js

  1. There are 3 examples under examples folders: demo.js, interactive.js and get-batch.js.
---------------------- batch no: 1 ----------------------
### page no 1
    id,	isbn,	title
1:	00368,	1617291692,	The Well-Grounded Rubyist, Second Edition
2:	00352,	1617291455,	Ember.js in Action
3:	00349,	1617291412,	The Joy of Clojure, Second Edition
4:	00289,	1617290629,	CoffeeScript in Action
5:	00387,	1617292133,	Learn SQL Server Administration in a Month of Lunches
### page no 2
    id,	isbn,	title
1:	00186,	1935182994,	EJB 3 in Action, Second Edition
2:	00350,	1617291420,	iOS 7 in Action
3:	00358,	1617291560,	Practical Data Science with R
4:	00324,	1617291021,	Solr in Action
5:	00305,	1617290904,	Play for Java
### page no 3
    id,	isbn,	title
1:	00336,	1617291218,	The Mikado Method
2:	00323,	1617291056,	Kanban in Action
3:	00302,	1617290823,	Mule in Action, Second Edition
4:	00341,	1617291307,	Gradle in Action
5:	00291,	1617290491,	HTML5 in Action
### page no 4
    id,	isbn,	title
1:	00272,	1617290327,	Ext JS in Action, Second Edition
2:	00365,	1617291374,	Windows Phone 8 in Action
3:	00317,	1617290971,	Learn Windows IIS in a Month of Lunches
4:	00301,	1617290394,	Linked Data
5:	00306,	1617290920,	Hello World! Second Edition

batch_key: 2x7xAh2OteQAorX33uvpYBeGdIZ-2wlXBxTHH4BCypr3FkFASqHbMibqnO
start_page_no: 1 has_prev: false has_next: true
metrics: {"read_docs":1,"write_docs":1,"delete_docs":0,"runtime":372}

for current batch: 	node demo.js 2x7xAh2OteQAorX33uvpYBeGdIZ-2wlXBxTHH4BCypr3FkFASqHbMibqnO
for next batch: 	node demo.js 2x7xAh2OteQAorX33uvpYBeGdIZ-2wlXBxTHH4BCypr3FkFASqHbMibqnO NEXT
batch_key: 9SVCj9yVtNQz9XhHyAvmBLe96jA-2wlXBxTHOTwmCC5ZKspLzfl06Nkbo8
start_page_no: 1 has_prev: false has_next: true
metrics: {"read_docs":1,"write_docs":1,"delete_docs":0,"runtime":382}

*** preview result: {"total":78,"cached_count":78}
metrics: {"read_docs":1,"write_docs":1,"delete_docs":0,"runtime":338}

Q Quit
C Redo current pages (default)
P Show previous pages
N Show next pages
batch_key: 9SVCj9yVtNQz9XhHyAvmBLe96jA-2r7nSAPOpSKJWv8EpruMm9jAmJekWghiMSF8gs
start_page_no: 5 has_prev: true has_next: true
metrics: {"read_docs":1,"write_docs":1,"delete_docs":0,"runtime":511}

config file