Canonical URL:
https://alexstevovich.com/a/link-tote-nodejs
Software URL:
https://midnightcitylights.com/software/link-tote-nodejs
A small and flexible link catalog for Node.js — ideal for managing platform links, external URLs, and references within a site or project.
link-tote supports loading, filtering, and removing entries directly from JSON files.
npm install link-toteimport LinkTote from 'link-tote';
// Initialize with data
const tote = new LinkTote([
{
id: 'github',
name: 'GitHub',
url: 'https://github.com/example',
type: 'dev',
tags: ['external'],
},
{
id: 'studio',
name: 'Example Studio',
url: 'https://studio.example.com',
type: 'brand',
tags: ['owned'],
},
]);
console.log(tote.getById('github'));
console.log(tote.getAllByType('dev'));
console.log(tote.getAllByTag('owned'));[
{
"id": "github",
"name": "GitHub",
"url": "https://github.com/example",
"type": "dev",
"tags": ["external"]
},
{
"id": "studio",
"name": "Example Studio",
"url": "https://studio.example.com",
"type": "brand",
"tags": ["owned"]
}
]await tote.loadFromFile('./data/links.json');Appends or loads multiple entries into the catalog.
Automatically normalizes missing types and wraps single string tags in an array.
Asynchronously loads entries from a JSON file (expects an array of objects).
Logs an error if the file cannot be read or is invalid.
Returns all entries in the catalog.
Retrieves a single entry by its ID. Returns null if not found.
Removes an entry by ID.
Returns all entries containing one or more specified tags.
Removes all entries containing a specific tag.
Removes entries whose url matches any entry in a given list of objects (expects url fields).
Licensed under the Apache License 2.0.