Code Monkey home page Code Monkey logo

uploadcare-node's Introduction

uploadcare-node

Node module for uploadcare.com that allows API interaction as well as local file upload.

Usage

    var uploadcare = require('../lib/main')('public_key', 'private_key'),
        fs = require('fs');

    //
    //API interaction
    uploadcare.files.info('file_id', handler);
    uploadcare.files.store('file_id', handler);
    uploadcare.files.remove('file_id', handler);
    uploadcare.groups.info('group_id', handler);

    //
    //Paginated list of files/groups info
    uploadcare.files.list({page: 1, limit: 100}, handler);
    uploadcare.groups.list({page: 1, limit: 100}, handler);

    //
    //Upload from file
    uploadcare.file.upload(fs.createReadStream(path), function(err,res){
        //Res should contain returned file ID
        console.log(err,res);
    });

    //
    //Upload from URL
    uploadcare.file.fromUrl('http://host/image/path', function(err,res){
        //Res should contain returned file ID
        console.log(err,res);
    })

Installation

npm install uploadcare

CLI

Install uploadcare globally (npm install -g uploadcare) and you have a CLI tool for interacting with the REST API.

Commands

info / i

Get info for an uploadcare file or group.

# Single file
uc info --pub=demopublickey --priv=demoprivatekey 1b53f25b-ac5e-46e7-9a76-8bf77d755c55
# Group of files
uc info --pub=demopublickey --priv=demoprivatekey 80077b0a-3882-4bbc-b4f4-aabf45ff8fb7~3

Options

  • -u, --pub Public key to use (REQUIRED)
  • -r, --priv Private key to use (REQUIRED)
  • -p, --pretty Pretty print the response

uploadcare-node's People

Contributors

alanshaw avatar asanchezdelc avatar evaletolab avatar homm avatar oleduc avatar rexmorgan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.