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

@solid-data-modules/bookmarks-rdflib

v0.3.0

Published

A library to manage bookmarks in Solid Pods based on rdflib.js

Downloads

65

Readme

Bookmarks - Solid Data Module for rdflib

A data module to manage bookmarks in Solid Pods in an interoperable way.

Usage

Installation via npm

npm install rdflib @solid-data-modules/bookmarks-rdflib

Usage in the brower via CDN

You can use the module directly in the browser (without any install or build step) by using the esm.sh CDN and an import map:

<script type="importmap">
  {
    "imports": {
      "@solid-data-modules/bookmarks-rdflib": "https://esm.sh/@solid-data-modules/bookmarks-rdflib",
      "rdflib": "https://esm.sh/rdflib"
    }
  }
</script>
<script type="module">
  import BookmarksModuleRdfLib from "@solid-data-modules/bookmarks-rdflib";
  import { Fetcher, graph, UpdateManager } from "rdflib";
  // ... use the module as described in the quick start
</script>

Quick start

import {Fetcher, graph, UpdateManager} from "rdflib";
import BookmarksModuleRdfLib, { BookmarksModule } from "@solid-data-modules/bookmarks-rdflib";

// 1️⃣ create rdflib store, fetcher and updater as usual
const store = graph();
const fetcher = new Fetcher(
        store,
        // 💡 pass an authenticated fetch
        // to be able to access private resources*
        /* fetch: authenticatedFetch */
);
const updater = new UpdateManager(store);

// 2️⃣ create the bookmarks module
const module: BookmarksModule = new BookmarksModuleRdfLib({store, fetcher, updater});

// 3️⃣ use the module to interact with bookmarks
const uri = await bookmarks.createBookmark({
  storageUrl: "http://localhost:3000/alice/public/bookmarks",
  title: "My favorite website",
  url: "https://favorite.example"
})

Example scripts

Executable example scripts how to use the module can be found in ./examples folder.

The development server needs to be running and initialized for this.

After that you can run an example script like this:

npm run build
node ./examples/create-bookmark-within-container.mjs

Available features

For a description of all features available please take a look at the module API documentation.

Development

Run tests

Unit and integration tests

npm test

End-to-end tests

The tests will start and stop their own solid server on port 3456. This port needs to be available.

npm run test:e2e

The server is seeded with data from src/e2e-tests/test-data initially. After a test run you can investigate the pod file system at src/e2e-tests/.test-data/<test-id> where <test-id> is a random id generated for each run.

Build

npm run build

Development server

Start server

You can start a development solid server via:

npm run pod

This will seed an account and an empty pod for test user alice. Find the credentials of that account in ../dev-server/seed.json

Initialize example data

To add some example data to this pod run

npm run pod:init

To start from scratch run

npm run pod:clean

and repeat from start of the section.

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.