npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nebstore-client

v1.0.7

Published

Nebula client node package

Downloads

51

Readme

NebStore Client

Nebstore Client is a JavaScript-based client that provides an easy-to-use interface for managing cloud storage services with NebStore. It enables you to create, list, and manage buckets and objects with simple method calls.

Features

  • Create, list, and delete buckets.
  • Upload, list, and delete objects.
  • Pagination support for list operations.
  • File uploads using FormData.

Installation

You can install the package using npm or yarn.

Using npm

npm install nebstore-client

using yarn

yarn add nebstore-client
import { NebStore } from 'nebstore-client'
const nebStore = new NebStore('your-api-token')

List Buckets

// List all buckets with pagination
const params = {
  page: 1,
  limit: 10,
  startDate: new Date('2024-01-01'),
  endDate: new Date(),
}

const response = await nebStore.listBuckets(params)
console.log(response)

Parameters

  • page: Page number.
  • limit: Number of buckets per page.
  • startDate: The start date to filter the list.
  • endDate: The end date to filter the list.

List Objects in a bucket

// Lists all objects in a specific bucket with pagination.
const params = {
  page: 1,
  limit: 10,
  startDate: new Date('2024-01-01'),
  endDate: new Date(),
}

const response = await nebStore.listObjects('bucketName', params)
console.log(response)

Parameters

  • bucketName: The name of the bucket.
  • params: An object containing pagination and filtering options (similar to listBuckets).

Create bucket

// Creates a new bucket with specified details.
const newBucket = {
  bucketName: 'my-new-bucket',
  region: 'sa-1',
  isPrivate: true,
}
const response = await nebStore.createBucket(newBucket)
console.log(response)

Parameters

  • params: An object containing:
    • bucketName: The name of the new bucket.
    • region: The region of the bucket (e.g., 'sa-1').
    • isPrivate: Optional boolean to set the bucket as private.

Empty bucket

// Empties all objects from a specified bucket.
const response = await nebStore.emptyBucket('bucketName')
console.log(response)

Parameters

  • bucketName: The name of the bucket to empty.

Get bucket

// Fetches the details of a specified bucket.
const response = await nebStore.getBucket('bucketName')
console.log(response)

Parameters

  • bucketName: The name of the bucket.

Get Object

// Fetches the details of a specific object in a bucket.
const response = await nebStore.getObject('bucketName', 'objectKey').console.log(response)

Parameters

  • bucketName: The name of the bucket.
  • objectKey: The key or name of the object.

Upload Object

// Uploads an object (file) to a specific bucket.
const fs = require('fs')
const file = fs.createReadStream('path/to/file.txt')

const response = await nebStoreuploadObject('my-new-bucket', 'my-object-key', file)
console.log(response)

Parameters

  • bucketName: The name of the bucket.
  • objectKey: The key or name to assign to the object.
  • file: The file to be uploaded (as FormData).

Delete bucket

// Deletes a specified bucket.
const response = await nebStore.deleteBucket('bucketName')
console.log(response)

Parameters

  • bucketName: The name of the bucket.

Delete Object

// Deletes a specific object from a bucket.
const response = await nebStore.deleteObject('bucketName', 'objectKey')
console.log(response)

Parameters

  • bucketName: The name of the bucket.
  • objectKey: The key or name of the object to delete.