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

json-silo

v1.1.5

Published

A data silo for digital twins in context-aware physical spaces. We believe in an open Internet of Things.

Downloads

119

Readme

json-silo

A lightweight digital twins store and API for the IoT

The json-silo is a digital twins store and an accessory module of Pareto Anywhere open source middleware for context-aware physical spaces.

Overview of json-silo

Specifically, the json-silo stores "stories" which are machine-readable representations of people, products, places, etc. in the form of JSON-LD and Schema.org. Additionally, it provides a simple mechanism for file storage and retrieval, for any accompanying metadata such as images. The json-silo can run standalone, even on resource-constrained devices.

Installation

npm install json-silo

Hello json-silo!

npm start

Browse to localhost:3001/json-silo/ and observe the json-silo logo. Interact with the json-silo via its REST API.

REST API

The json-silo's REST API includes the following two base routes:

  • /stories for retrieving/specifying digital twins
  • /store for storing and retrieving metadata such as /images

POST /stories

Create a story. The id of the created story is provided in the response.

Example request

| Method | Route | Content-Type | |:-------|:---------|:-----------------| | POST | /stories | application/json |

{
  "@context": {
    "schema": "https://schema.org/"
  },
  "@graph": [
    {
      "@id": "person",
      "@type": "schema:Person",
      "schema:givenName": "barnowl"
    }
  ]
}

Example response

{
  "_meta": {
    "message": "ok",
    "statusCode": 200
  },
  "_links": {
    "self": {
      "href": "http://localhost:3000/stories"
    }
  },
  "stories": {
    "barnowl": {
      "@context": {
        "schema": "https://schema.org/"
      },
      "@graph": [
        {
          "@id": "person",
          "@type": "schema:Person",
          "schema:givenName": "barnowl"
        }
      ]
    }
  }
}

GET /stories/{id}

Retrieve the story with the given id.

Example request

| Method | Route | Content-Type | |:-------|:-----------------|:-----------------| | GET | /stories/barnowl | application/json |

Example response

{
  "_meta": {
    "message": "ok",
    "statusCode": 200
  },
  "_links": {
    "self": {
      "href": "http://localhost:3000/stories/barnowl"
    }
  },
  "stories": {
    "barnowl": {
      "@context": {
        "schema": "https://schema.org/"
      },
      "@graph": [
        {
          "@id": "person",
          "@type": "schema:Person",
          "schema:givenName": "barnowl"
        }
      ]
    }
  }
}

POST /store/images

Upload an image to the store. The id (modified filename) of the uploaded image is provided in the response. The image is modified using sharp to conform to standard dimensions before it is stored on the filesystem.

Example request

| Method | Route | Content-Type | |:-------|:--------------|:--------------------| | POST | /store/images | multipart/form-data |

GET /store/images/{id}

Retrieve the image with the given id (filename).

Example request

| Method | Route | Content-Type | |:-------|:---------------------------|:--------------------| | POST | /store/images/12345678.jpg | multipart/form-data |

What's in a name?

The json-silo is exactly that: a data silo for JSON! Simple enough, right? So why does it have a grain silo with a hockey mask for a mascot?

At reelyActive we've always been outspoken about the need for an open Internet of Things as opposed to a bunch of siloed applications. In 2013, on social media we recycled the "More cowbell" meme with an image of Will Ferrell banging on a grain silo with the caption "The Internet of Things does not need More Silo". When it came time to create a mascot for the json-silo, we decided to start with that grain silo.

Now, how do you visually represent JSON in association with a grain silo? Sure, we could have slapped the official JSON logo on that silo, but where's the fun in that? Instead, for those of us who grew up in the eighties, hearing "JSON" out of context (pun intended) evokes the image of Jason Voorhees from the Friday the 13th series of films, specifically the iconic hockey goaltender mask he wore. Not only does that "Jason" mask make for a silly visual pun, it also gives a nod to our hometown heritage, where Jacques Plante of the Montreal Canadiens was the first goaltender to wear such a mask full-time, which would later become standard practice. We'd be pleased to see the use of personal data lockers become standard practice too.

json-silo logo

What's next?

json-silo v1.0.0 was released in August 2019, superseding all earlier versions, the latest of which remains available in the release-0.5 branch and as [email protected] on npm.

json-silo v1.1.0 migrates to ESMapDB from NeDB. If upgrading from a previous version, any stored stories will need to be recreated.

Contributing

Discover how to contribute to this open source project which upholds a standard code of conduct.

Security

Consult our security policy for best practices using this open source software and to report vulnerabilities.

License

MIT License

Copyright (c) 2014-2024 reelyActive

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.