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

fvi-skynet-dao

v0.0.1

Published

FVI - Data Access Object for Skynet

Downloads

1

Readme

‘Own The Internet’ Hackathon

  • Hackathon page: https://gitcoin.co/hackathon/own-the-internet

Handshake

  • Project page: https://handshake.org
  • Learn Center: https://learn.namebase.io

Sia

  • Project page: https://siasky.net
  • Docs: https://sia.tech/docs/#skynet

Freunde Von Ideen - Node Data Access Object for Skynet

DAO Skynet Library, to access your JSON like Object data.

Using

  • Terminal
mkdir test-dao-skynet
cd test-dao-skynet
npm install --save fvi-skynet-dao
touch index.js
vi index.js
  • Vi (Text editor)
const SkynetDao = require('fvi-skynet-dao')

const opts = {
    // required
    modelId: 'unique id model',
    // optional
    mock: {
        onDownloadItem: (propId, skylink) => fs.createReadStream('test.xyz'),
        onDownloadIndexes: skylink => fs.createReadStream('test.xyz'),
        onUploadItem: (propId, idxs, currentSkylinkIdxs, data) => fs.createReadStream('test.xyz'),
        onUploadIndexes: indexes => fs.createReadStream('test.xyz'),
    },
    // optional
    indexes: {
        propId: 'myPropId', // optional, defaults "id"
        idxs: ['status'], // optional, index fields to find
        skylink: 'skylink_to_initial_indexes', // optional
    },
}

const dao = SkynetDao(opts)

Create Object

const modelItem = {
    status: true,
    firstName: 'First',
    lastName: 'Last name',
    tags: ['developer', 'nodejs', 'skynet'],
}

dao.create(modelItem)
    .then(res => console.log(res))
    .catch(e => console.error(e))

/*
Example of success print:
{
    item: {
        myPropId: 'CABAB_1Dt0FJsxqsu_J4TodNCbCGvtFf1Uys_3EgzOlTcg',
        firstName: 'First',
        lastName: 'Last',
        status: true,
        skylink: 'sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I',
        _versions: []
    },
    indexes: {
        values: [{status: true, skylink: 'sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I'}],
        skylink: 'sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I',
        _versions: []
    }
}
*/

Read Object

dao.read('sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I')
    .then(res => console.log(res))
    .catch(e => console.error(e))
/*
Example of success print:
{
    myPropId: 'CABAB_1Dt0FJsxqsu_J4TodNCbCGvtFf1Uys_3EgzOlTcg',
    firstName: 'First',
    lastName: 'Last',
    status: true,
    skylink: 'sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I',
    _versions: []
}
*/

Indexes

dao.indexes()
    .then(res => console.log(res))
    .catch(e => console.error(e))

/*
Example of success print:
{
    values: [{status: true, skylink: 'sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I'}],
    skylink: 'sia://QAf9Q7dBSbMarLvyeE6HTQmwhr7RX9VMrP9xIMzpU3I',
    _versions: []
}
*/

fvi-skynet-dao

  • npm run compile: Clean temp files and e directories.
  • npm run debug-test: Run mocha unit tests with DEBUG enabled.
  • npm run test: Run mocha unit tests.
  • npm run debug-dev: Run dev mode, waiting for changes to run unit tests with DEBUG enabled (watch mode).
  • npm run dev: Run dev mode, waiting for changes to run unit tests.
  • npm run prod: Run with NODE_ENV=production.
  • npm run coverage: Run unit tests and coverage with nyc.
  • npm run release: Init git flow release from next package version, patch, git flow.
  • npm run release:minor: Init git flow release from next package version, minor, git flow.
  • npm run release:major: Init git flow release from next package version, major, git flow release start.
  • npm run release:finish: Finish current releas, git flow.