Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drive-album

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drive-album

Tranform a public google drive into an album api for your images

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Drive-album v1.0.1

Transform a google drive folder into an api to stock your images and albums

Update

  • Fixed image url

Installation ?

npm i drive-album

How to use ?

  • Dont forget to set the folder in public mode

Example public

const GetGoogleDrive = require('drive-album');

const drive = await GetGoogleDrive("https://drive.google.com/drive/folders/1UJ4PiRfyhPelXacznccRoGBPXLDEDvCb?usp=sharing");
const drive = await GetGoogleDrive("1UJ4PiRfyhPelXacznccRoGBPXLDEDvCb");

//if you want to explore all the subtree folders
await GetGoogleDrive(..., true);

Result

  • Subtree exploring
[
    {
        "id": "1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
        "name": "ALBUM1",
        "realType": "application/vnd.google-apps.folder",
        "type": "folder",
        "url": "https://drive.google.com/drive/folders/1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
        "content": [
            {
                "id": "19mppIinV6H-5yEJrpI_IEV6kOaqcYXYV",
                "name": "testimage.png",
                "realType": "image/png",
                "type": "image",
                "url": "https://lh3.google.com/u/0/d/19mppIinV6H-5yEJrpI_IEV6kOaqcYXYV=w1920-h942-iv2"
            }
        ]
    },
    {
        "id": "1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
        "name": "ALBUM2",
        "realType": "application/vnd.google-apps.folder",
        "type": "folder",
        "url": "https://drive.google.com/drive/folders/1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
        "content": []
    },
    {
        "id": "18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA",
        "name": "testimage1.png",
        "realType": "image/png",
        "type": "image",
        "url": "https://lh3.google.com/u/0/d/18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA=w1920-h942-iv2"
    }
]
  • No subtree exploring (You can see the content of a folder with GetGoogleDrive("Folder id"))
[
    {
        "id": "1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
        "name": "ALBUM1",
        "realType": "application/vnd.google-apps.folder",
        "type": "folder",
        "url": "https://drive.google.com/drive/folders/1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
    },
    {
        "id": "1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
        "name": "ALBUM2",
        "realType": "application/vnd.google-apps.folder",
        "type": "folder",
        "url": "https://drive.google.com/drive/folders/1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
    },
    {
        "id": "18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA",
        "name": "testimage1.png",
        "realType": "image/png",
        "type": "image",
        "url": "https://lh3.google.com/u/0/d/18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA=w1920-h942-iv2"
    }
]

Example

const GetGoogleDrive = require('drive-album');
const fs = require('fs');

async function test(){
    const drive = await GetGoogleDrive("1UJ4PiRfyhPelXacznccRoGBPXLDEDvCb", true);
    fs.writeFileSync("test.json", JSON.stringify(drive, undefined, 4));
}

test();

Keywords

FAQs

Package last updated on 23 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc