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 🙏

© 2026 – Pkg Stats / Ryan Hefner

solid-logic

v4.0.6

Published

Core business logic of SolidOS

Downloads

6,759

Readme

solid-logic

MIT license

Core business logic of SolidOS which can be used for any webapp as well.

Usage

📦 Install via npm

npm install solid-logic rdflib

Important: rdflib is a peer dependency - you must install it separately.

Import in your project (ESM/TypeScript)

import { solidLogicSingleton, store, authn } from 'solid-logic';

// Example usage
console.log('Current user:', authn.currentUser());

🌐 Use directly in a browser

Both UMD and ESM bundles externalize rdflib to keep bundle sizes small and avoid version conflicts.

Available Files

| Format | File | Usage | Global Variable | |--------|------|-------|----------------| | UMD | dist/solid-logic.js | Development | window.SolidLogic | | UMD | dist/solid-logic.min.js | Production | window.SolidLogic | | ESM | dist/solid-logic.esm.js | Development | Import only | | ESM | dist/solid-logic.esm.min.js | Production | Import only |

UMD Bundle (Script Tags)

⚠️ Important: Load rdflib before solid-logic or you'll get $rdf is not defined errors.

<!-- 1. Load rdflib first (creates window.$rdf) -->
<script src="https://cdn.jsdelivr.net/npm/rdflib/dist/rdflib.min.js"></script>

<!-- 2. Load solid-logic (expects $rdf to exist) -->
<script src="https://unpkg.com/solid-logic/dist/solid-logic.min.js"></script>

<script>
	// Access via global variable
	const { solidLogicSingleton, store, authn } = window.SolidLogic;
	
	// Example usage
	console.log('Store:', store);
	console.log('Authentication:', authn.currentUser());
</script>

ESM Bundle (Native Modules)

<script type="module">
	import * as $rdf from 'https://esm.sh/rdflib';
	import { solidLogicSingleton, store, authn } from 'https://esm.sh/[email protected]';

	// Example usage
	console.log('Store:', store);
	console.log('Authentication:', authn.currentUser());
</script>

ESM with Import Maps (Recommended)

<script type="importmap">
{
	"imports": {
		"rdflib": "https://esm.sh/rdflib",
		"solid-logic": "https://esm.sh/[email protected]"
	}
}
</script>
<script type="module">
	import * as $rdf from 'rdflib';
	import { solidLogicSingleton, store, authn } from 'solid-logic';

	// Example usage - cleaner imports!
	console.log('Store:', store);
	console.log('Authentication:', authn.currentUser());
</script>

Common Exports

import { 
	solidLogicSingleton,  // Complete singleton instance
	store,                // RDF store
	authn,                // Authentication logic
	authSession,          // Authentication session
	ACL_LINK,            // ACL constants
	getSuggestedIssuers,  // Identity provider suggestions
	createTypeIndexLogic, // Type index functionality
	// Error classes
	UnauthorizedError,
	NotFoundError,
	FetchError
} from 'solid-logic';

How to develop

Check the scripts in the package.json for build, watch, lint and test.

Used stack

  • TypeScript + Babel
  • Jest
  • ESLint
  • Webpack

How to release

Change version and push directly to main. This will trigger the npm release latest script in CI.

History

Solid-logic was a move to separate business logic from UI functionality so that people using different UI frameworks could use logic code.

It was created when the "chat with me" feature was built. We needed to share logic between chat-pane and profile-pane (which was part of solid-panes back then I think) due to that feature. The whole idea of it is to separate core solid logic from UI components, to make logic reusable, e.g. by other UI libraries or even non web apps like CLI tools etc.