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

ass-client

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ass-client

Aptoma Smooth Storage client

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-92.31%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

ass-client

Node client for Aptoma Smooth Storage

Installation

This module is installed via npm:

$ npm install ass-client

Examples

Upload and resize image

var ass = require('ass-client')({
	httpUrl: 'http://ass.com',
	httpsUrl: 'https://ass.com',
	accessToken: 'secret',
	username: 'foobar'
});

ass.uploadImage('my.jpg').then(function (res) {
	console.log('Image uploaded', res.body);

	var signedUrl = ass.createImageUrl(res.body.id, { resize: { width: 10, height: 10 } });
	//create a signed url for the uploaded image in a different size
	console.log('Smaller image', url);
})

Documentation

ASS(opts, opts.httpUrl, opts.httpsUrl, opts.accessToken, opts.username)

Create ASS API instance

Parameters

opts: Object, Create ASS API instance

opts.httpUrl: String, Create ASS API instance

opts.httpsUrl: String, Create ASS API instance

opts.accessToken: String, Create ASS API instance

opts.username: String, Create ASS API instance

getDefaultHeaders(add)

Get default headers

Parameters

add: Object, headers

Returns: Object,

upload(endpoint, file)

Upload file to endpoint

Parameters

endpoint: String, Upload file to endpoint

file: String | stream.Readable, full path to the file or stream.Readable

Returns: Promise, Resolves with response object

uploadFile(file)

Upload a file to /files endpoint

Parameters

file: String | stream.Readable, full path to the file or stream.Readable

Returns: Promise, Resolves with response object

uploadImage(file)

Upload a

Parameters

file: String | stream.Readable, full path to the file or stream.Readable

Returns: Promise, Resolves with response object

post(endpoint)

Make a post request to an endpoint

Parameters

endpoint: String, Make a post request to an endpoint

Returns: Promise, Resolves with response object

get(endpoint)

Make a get request to an endpoint

Parameters

endpoint: String, Make a get request to an endpoint

Returns: Promise, Resolves with response object

getUrl(endpoint, http)

Get full url to ASS endpoint, defaults to https url

Parameters

endpoint: String, Get full url to ASS endpoint, defaults to https url

http: Boolean, if we should return http url

Returns: String,

createImageUrl(id, actions)

Create a signed url from image id and actions

Parameters

id: Integer, image id

actions: Object, Create a signed url from image id and actions

Returns: String,

createSignature(url)

Create signature for a image or file url

Parameters

url: String, Create transformation signature

Returns: String,

Keywords

FAQs

Package last updated on 30 Sep 2014

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