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

pausa-user2csv

v1.0.0

Published

transforma la estructura de datos de usuarios a un csv con metadatos

Downloads

3

Readme

USERS2CSV

Este pequeño script de javascript facilitará la generación de reportes en formato csv de todos los usuarios de la aplicación, transforma las amplias solicitudes a firebase a través de una paginación interna y lo parsea a un json que pueda ser manejado por la librería json2csv.

INSTALACIÓN

Para instalar esta utilidad es necesario que lo agregues como una dependencia global a través de NPM.

# Instalación como dependencia global
$ npm install -g pausa-users2csv -s 

Algunas de nuestras dependencias requiren Node v6 o superior, pero el codigo de el proyecto solo ha sido probado bajo Node v10.

CLI

users2csv esta programado solo para ser usado desde la consola de comandos

Uso: users2csv [options]

Options:
  -V, --version            output the version number
  -c --credentials <path>  Path and name of the json file of credentials for firebase-admin SDK (Service Account Key)
  -d --database <url>      Url of the firebase database for the connection
  -r --reference <path>    Path to the reference that you want to pull (default: "users")
  -p --pages <limit>       Define the max amount of pages to iterate (default: null)
  -q --quantity <size>     Define the amount of results per page in the iteration (default: 5)
  -o --output <path>       Define the path of the output file to write the csv in (default: "users.csv")
  -s --separator <char>    Defines the separator for the values of the csv file (default: ",")
  -h, --help               output usage information

Antes de empezar asegurate de descargar el Service Account Key en formato JSON de la cuenta de firebase e indica el path a este archivo con la opción -c. Si no se especifica una cantidad de paginas máxima con -p, por defecto se recorreran todas las páginas que existan dentro de la base de datos.

Uso

# Uso sencillo
$ users2csv -c local/service.json -d database.firebaseio.com

# Modifica el archivo de salida y el separador (para compatibilidad con windows Excel por ejemplo)
$ users2csv -c local/service.json -d database.firebaseio.com -o desktop/myusersreport.csv -s ;

# Establece un limite de paginas a recorrer
$ users2csv -c local/service.json -d database.firebaseio.com -p 5
# También puedes modificar cuantos registros se solicitaran por pagina. Selecciona una cantidad 
# razonable que haga el proceso más rapido pero sin teniendo en cuanto las limitaciones de el equipo
# en donde se ejecuta el script.
$ users2csv -c local/service.json -d database.firebaseio.com -p 5 -q 2000

# Si es necesario en algún momento modificar la referencia de la base de datos a la que apuntan las
# consultas puedes hacerlo con la opción -r
$ users2csv -c local/service.json -d database.firebaseio.com -r usersnuevos
# NOTA: ten en cuenta que estas referencias se intentarán parsear por lo que los registros debe poseer
# una estructura compatible con la estructura de usuarios esperada.