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

cloudrive

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudrive

wrapers for cloud storage API (onedrive, ...) for Node and browser.

  • 0.1.7
  • latest
  • npm
  • Socket score

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

cloudrive

wrapers for cloud storage API (onedrive, ...) for Node and browser.

Usage

  • install
npm install cloudrive
  • import to your code
const { OneDrive } = require('cloudrive')
  • upload plain text
    // Your onedrive oauth access token
    const tok = process.env.ONE_DRIVE_TOKEN
    const api = new OneDrive(tok)
    const dest = `test/hello.txt`
    const content = 'hello world'
    const res = await api.upload({ dest, content })
    if (res.ok) {
      console.log('ok')
    } elese {
      console.log(`error: ${res.status} ${res.statusText}`)
    }
  • upload image
    // Your onedrive oauth access token
    const tok = process.env.ONE_DRIVE_TOKEN
    const api = new OneDrive(tok)
    const dest = `test/hello.jpeg`
    const content = fs.readFileSync('<path to your image>')
    const res = await api.upload({ dest, content })
    if (res.ok) {
      console.log('ok')
    } elese {
      console.log(`error: ${res.status} ${res.statusText}`)
    }
  • download a file
    // Your onedrive oauth access token
    const tok = process.env.ONE_DRIVE_TOKEN
    const api = new OneDrive(tok)
    const res = await api.download('test/hello.txt')
    if (res.ok) {
      console.log('ok')
    } elese {
      console.log(`error: ${res.status} ${res.statusText}`)
    }

FAQs

Package last updated on 22 Apr 2020

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