Registry / web-framework / wiki-server

wiki-server

JSON →
library0.26.3jsnpmunverified

Wiki-Server is the core Node.js server implementation for the Federated Wiki project, version 0.26.3. It serves as a backend component for a federated, single-page wiki application, handling read-write operations for page content across multiple sources. The project, stemming from the 'Smallest Federated Wiki' (SFW) initiative, emphasizes modularity, event-driven architecture, dependency injection, and a clear separation between DOM and business logic. It differentiates itself by supporting a distributed content model where a single application can read from many wiki sources and write updates to a few, contrasting with monolithic wiki implementations. The package is actively maintained, with recent updates, though it remains in a 0.x versioning scheme, indicating ongoing development and potential for minor version breaking changes. Its release cadence appears to be driven by ongoing development within the broader Federated Wiki ecosystem, as new versions are published periodically. The server primarily uses Express.js for its HTTP backend.

npm install wiki-server
INSTALL
IMPORT
SIG · WIKI-SERVER
W
wiki-server
web-frameworkjavascriptv0.26.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createServer
import { createServer } from 'wiki-server'; // Or for CommonJS: const { createServer } = require('wiki-server');
import wikiServer from 'wiki-server';
The primary way to use wiki-server is by importing its server creation function. While Node.js >=20 supports ESM, many older Node.js projects default to CommonJS. Dual-packaging is common, but explicit named imports for CJS are safer for non-default exports.
WikiServer
import WikiServer from 'wiki-server'; // Or for CommonJS: const WikiServer = require('wiki-server');
const { WikiServer } = require('wiki-server');
Some Node.js server modules export the main server factory as a default export, or a class. Assuming it exports a function to instantiate the server. If it's a class, `new WikiServer()` would be used. Without clear documentation, both named and default export patterns for a main entity are common. It's best to check the actual package for precise export names if issues arise.

Demonstrates how to integrate and start the `wiki-server` as an Express-compatible application, listening on a specified port.

const express = require('express'); const wikiServer = require('wiki-server'); const app = express(); // Mount the wiki-server application onto a base path, e.g., '/wiki' // The 'wiki-server' module is expected to return an Express-compatible router or app instance. // This example assumes wikiServer() returns an Express router/app. app.use('/wiki', wikiServer()); const PORT = process.env.PORT || 3000; app.listen(PORT, () => { console.log(`Federated Wiki Server running on http://localhost:${PORT}/wiki`); console.log('You might need the `wiki` package to provide the full client experience.'); console.log('Default data directory is usually ~/.wiki, but can be configured.'); });
Debug
Known issues
breakingA significant code re-organization occurred around New Year 2013/2014, splitting the client and server into separate repositories. This means older `wiki` package versions or directly cloned repos from before this date will be incompatible.
fix
Ensure you are using `wiki-server` from the `fedwiki/wiki-server` GitHub repository and npm package. Update your local clone's upstream remote if you forked the old repository.
affects: <0.1.0
breakingThe GitHub repository name and location changed from an unspecified previous name to `fedwiki/wiki-server`. Direct references or old forks will point to an incorrect or outdated location.
fix
Update all links and repository references to `https://github.com/fedwiki/wiki-server`.
affects: all
gotchaThe `wiki-server` package is a backend component. To run a complete Federated Wiki instance with a client-side interface, you will typically need the `wiki` package (fedwiki/wiki) which orchestrates `wiki-server`, `wiki-client`, and plugins. Using `wiki-server` alone will provide the backend API but not the full user-facing wiki.
fix
For a full Federated Wiki experience, consider installing and running the `wiki` package, which bundles and manages `wiki-server` along with other necessary components, or integrate `wiki-server` with `wiki-client` manually.
affects: all
gotchaThe package adheres to semantic versioning (0.x.y) where any minor version change (0.x.Y to 0.x.(Y+1)) could potentially introduce breaking changes, as major version `0` implies an unstable API.
fix
Always review the changelog when updating minor versions (e.g., from 0.26.2 to 0.26.3) and perform thorough testing to account for potential API changes.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'express'
The `express` package, although integral to `wiki-server`'s operation, might not be a direct dependency listed in its `package.json` if it's treated as a peer dependency or implicitly expected.
fix
Install `express` manually: `npm install express`.
TypeError: wikiServer is not a function
The `wiki-server` module might not export a default function that directly returns an Express app or router. It could be exporting a class or an object with specific methods.
fix
Inspect the `wiki-server` package's `index.js` or main entry point to determine its exact export structure (e.g., `module.exports = { createServer, ... }` or `module.exports = function() { ... }`). Adjust your `require` or `import` statement accordingly.
Error: EACCES: permission denied, mkdir '/root/.wiki'
The server attempts to create a default data directory (`~/.wiki`) but lacks the necessary file system permissions, often when running as a non-privileged user or in a restricted environment like Docker.
fix
Configure a custom data directory with write permissions for the user running the server (e.g., `wikiServer({ dataDir: '/var/data/mywiki' })`) or ensure the default `~/.wiki` directory has appropriate permissions (e.g., `chmod -R 777 ~/.wiki`).
Upgrade
Version history
0.26.3latest on npm
Audit
Dependencies
expressrequiredProvides the HTTP server backend for handling web requests.
Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
1
Resources
wiki-server — npm install wiki-server · libregistry