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

appsheet-companion

v0.2.55

Published

Herramientas para facilitar el uso de Appsheets

Downloads

1,423

Readme

TS-NODE AppSheetCompanion

Herramienta para migración de datos almacenados en la plataforma Appsheets

Introducción

En el ámbito gubernamental del estado de Tamaulipas, se ha adoptado la tecnología Google AppSheets para desarrollar aplicativos simples que aborden problemáticas cotidianas. Sin embargo, conforme algunos de estos aplicativos muestran un potencial significativo, surge la necesidad imperante de migrarlos hacia plataformas más robustas. Es importante destacar que esta decisión no implica que Google AppSheets carezca de robustez; simplemente, se busca aprovechar plataformas con características adicionales para atender las crecientes demandas y complejidades de dichos aplicativos.

Introducción (SIN GPT)

Necesitamos una herramienta que nos permita llamar datos de hojas de spreadsheets de una manera más conveniente, así que se desarrolló esta herramienta (sencilla para mi al menos), que nos proporciona un api sencillo para poder cargar estos datos en memoria, pero convertidos a objetos faciles de manejar.

USO BÁSICO... POR QUE NO HAY OTRO

Imagina que tenemos una base de datos de usuarios en un archivo de spreadsheets

ejemplo1

Que necesitamos?

1.- Archivo Credentials.json de Google Lo puedes conseguir aquí 2.- Id del Spreadsheet 3.- Nombre de la Hoja 4.- Un nombre para cada columna dentro de tu código

ejemplo2

Dentro de tu proyecto de NodeJs, instala el paquete

NPM

npm i appsheet-companion

YARN

yarn add appsheet-companion

Uso

import { Init, type Companion, type SheetDataReq} from 'appsheet-companion'
async function main(){
    const companion = Init({
        credentials: 'path/to/credentials.json'
    });
    const usersRequest:SheetDataReq = {
        sheetName:'USERS',// hoja dentro del spreadsheet
        sheetRange:'A2:ZZ',
            googleFileId:'1_1qQIS-cZhQqjhPQmnwevrjOKuBJo8G6-G-p5hIwjXc', // id del spreadsheet
            // opcional, si no se especifica, se toman los nombres de las columnas de la primera fila de la hoja
            // y se procesan como underscore_case
            // ej. Nombre de columna: 'Nombre de Usuario' -> nombre_de_usuario
            columns:[{
                position:0,
                name:'id',
            },
            {
                position:1,
                name:'nombre'
            },
            {
                position:2,
                name:'apellido'
            },
            {
                position:3,
                name:'email'
            }]
        }
        const usersTable = companion.spreadSheetServices.useDataFromTable(usersRequest);
        console.log(usersTable.response.rawData); // Datos recibidos de la tabla en formato string[][]
        console.log(usersTable.response.data); // Datos recibidos de la tabla convertidos a objetos
        /* ej.
         [{
             id:'1',
             nombre:'Alan',
             apellido:'Torres',
             email:'[email protected]'
         }]
        */
    }