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

@netology-group/storage

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netology-group/storage

JavaScript API-client for Storage service

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
5
Weekly downloads
 
Created
Source

StorageJS

JavaScript API-client for Storage service

Installation

npm install --save @netology-group/storage

Example

import {
  AxiosHttpClient,
  SimpleTokenProvider,
  HttpStorageResource
} from '@netology-group/storage'

const TOKEN = 'jwt-token'
const bucket = 'example-bucket'
const set = '123'
const object = 'example.json'
const headers = {
  'cache-control': 'max-age=31536000',
  'content-type': 'application/json'
}
const data = {foo: 'bar'}

const storage = new HttpStorageResource(
  'https://example.com',
  'api/v1',
  new AxiosHttpClient(),
  new SimpleTokenProvider(TOKEN)
)

// signing request params
storage.sign({ method: 'PUT', bucket, set, object, headers })
  .then((response) => {
    console.log('[response]', response)
  })
  .catch((error) => {
    console.log('[error]', error)
  })
  
// uploading data
storage.upload({ bucket, set, object, headers }, data, {})
  .then((response) => {
    console.log('[response]', response)
  })
  .catch((error) => {
    console.log('[error]', error)
  })

FAQs

Package last updated on 20 May 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