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

@integrance/google-drive-v3-helper

v0.0.3

Published

Biblioteca que ajuda a trabalhar com a api V3 do google drive de maneira mais simplificada e com funcionalidades prontas.

Downloads

12

Readme

Google Drive V3 Helper

Biblioteca que ajuda a trabalhar com a api V3 do Google Drive de maneira mais simplificada e com funcionalidades prontas.

Objetivo

Esta biblioteca foi criada, a priori, para o uso em um outro produto para a startup Integrance, que, durante o desenvolvimento, foi notado uma pequena dificuldade em entender como algumas coisas funcionavam dentro do SDK da Google e como poderia ser chato e repetitivo a escrita de algumas funções. Para tentar resolver isso, a biblioteca nasceu para facilitar o trabalho com a api V3 do Google Drive e fornecer algumas funcionalidades prontas.

Funções

Atualmente, a biblioteca possui as seguintes funcionalidades:

  • Drive

    • saveFile: Salva um arquivo no drive;
    • getFile: Pega um arquivo do drive (informações e conteúdo);
    • getFilesInFolder: Pega todos os arquivos de uma pasta do drive (informações);
    • getFoldersInFolder: Pega todas as pastas de uma pasta do drive (informações);
    • getAllInFolder: Pega todos os arquivos e pastas de uma pasta do drive (informações);
    • createFolder: Cria uma pasta no drive;
    • deleteFileOrFolder: Deleta um arquivo ou pasta do drive;
    • copyFile: Copia um arquivo para outra (ou não) pasta do drive;
    • move: Move um arquivo para outra pasta do drive;
    • buildFunction: Fornece uma instância do drive_v3.Drive para criar e utilizar funções extras que não foram feitas acima;

    Novas funcionalidade serão adicionadas assim que possível. Por enquanto a biblioteca está me ajudando em outros sistemas que necessitam de conexão com a API do Google Drive V3, então enquanto estiver me suprindo, ela será bem estática e com poucas evoluções.

Instalação

Para instalar a biblioteca, basta realizar a instalação com um dos comandos abaixo:

Yarn: yarn add @integrance/google-drive-v3-helper

Npm: npm -i @integrance/google-drive-v3-helper

Uso

Para o uso da biblioteca, é necessário ter os seguintes requisitos:

- Criar um projeto no Google Cloud Platform;

- Ativar a API do Google Drive em seu projeto;

- Criar uma conta de serviço no Google Cloud Platform;

Após ter cumprido os requisitos, baixe o arquivo de credenciais (estrutura abaixo) que foi gerado nos passos anteriores:

// credentials.json
{
    "type": "",
    "project_id": "",
    "private_key_id": "",
    "private_key": "",
    "client_email": "",
    "client_id": "",
    "auth_uri": "",
    "token_uri": "",
    "auth_provider_x509_cert_url": "",
    "client_x509_cert_url": ""
}

Utilize-o da maneira que achar mais conveniente. No exemplo abaixo, iremos deixar o arquivo credentials.json na raiz do projeto e importaremos alguns informações de dentro dele utilizando require.

O exemplo abaixo mostra a configuração básica para a biblioteca:

// index.js
const { Drive } = require("@integrance/google-drive-v3-helper");

const { client_email, private_key } = require("./credentials.json");
const scopes = ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"];

const driveService = new Drive(client_email, private_key, scopes);

//driveService possui diversas funções prontas para serem utilizadas, fique livre para verificar seu conteúdo.

Licença

Este projeto é licenciado sob a MIT License

Copyright (c) 2022 Leonardo Petta do Nascimento

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Meta

Autor: Leonardo Petta do Nascimento

Email: [email protected]

Linkedin: https://www.linkedin.com/in/leonardo-petta-do-nascimento-75674015b/

Site pessoal: https://leonardopetta.dev/portfolio-web/