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

@dartroom/fileroom-sdk

v0.1.3-alpha

Published

A package to interact with the fileroom-api for both the browser and nodejs.

Downloads

6

Readme

fileroom-sdk

npm version CI Publish codecov License: MIT

A package to interact with the fileroom-api for both the browser and nodejs.

Requirements

Use of this SDK requires the following:

  • Node.js 16 or higher
  • Chrome 89 or higher, firefox 87 or higher, or safari 14 or higher

Installation

nodejs

 npm install @dartroom/fileroom-sdk
#or
    yarn add @dartroom/fileroom-sdk
#or
    pnpm add @dartroom/fileroom-sdk

browser

<script src="https://cdn.jsdelivr.net/npm/@dartroom/fileroom-sdk/dist/browser/index.min.js"></script>
// with a CDN, the SDK is available on the window object
const { Client } = Fileroom; // window.Fileroom
let client = new Client({
  accessToken: '<your access token>',
});

Usage

Commonjs with promises

const { Client } = require('@dartroom/fileroom-sdk');

const client = new Client({
  accessToken: 'your token', // optional
});
// import the ipfs and user api
let { ipfs, user } = client;

user
  .login({ username: 'username', password: 'password' })
  .then(res => {
    // do something with the response
    console.log(res);
  })
  .catch(err => {
    console.log(err);
  });

ES modules or Typescript with async/await

import { Client } from '@dartroom/fileroom-sdk';

const client = new Client({
  accessToken: 'your token', // optional
});

// import the ipfs and user api
let { ipfs, user } = client;

try {
  let res = await user.login({ username: 'username', password: 'password' });
  // do something with the response
  console.log(res);
} catch (err) {
  console.log(err);
}

SDK Reference

Tests

First, clone the repo locally and cd into the directory

git clone https//github.com/dartroom/fileroom-sdk.git
cd fileroom-sdk

Next, create a .env file, and add the following environment variables

#credentials for test Fileroom Dev User
TEST_DEV_USERNAME='your test fileroom dev username' ## this can be a random username
TEST_DEV_PASSWORD= 'your test fileroom dev password' ## this can be a random password
TEST_DEV_API_KEY='any active api key for the test fileroom dev user'

# fileroom Environment
FILEROOM_ENV='test | production| beta'
TEST_FILECID= "your test file cid"

Note: Setting the FIREROOM_ENV to 'test' will run the tests against the a locally run fileroom instance, If this variable is not set, the tests will default to the fileroom production environment.

Finally, run the tests.

  npm test
  # run tests in watch mode
    npm run test:watch

License

MIT License (MIT), see LICENSE.