Registry / database / whocallsthefleet-database

whocallsthefleet-database

JSON →
library20240308.0.1jsnpmunverified

The `whocallsthefleet-database` package provides a dataset specifically structured as an embedded NeDB database for the 'Who Calls the Fleet' project (https://fleet.moe), which focuses on Kantai Collection game data. NeDB is a lightweight, embedded document-oriented database written in JavaScript, offering a subset of MongoDB's API for querying. It is designed for small-scale applications, capable of operating in-memory or persisting data to a local file. The current version of this data package is `20240308.0.1`. The original NeDB project by louischatriot is considered abandoned, with development ceasing around 2017, although forks like `@seald-io/nedb` continue active maintenance and introduce modern JavaScript features like Promises. This package's primary differentiator is its specific dataset content for 'Who Calls the Fleet', using NeDB for local, file-based storage without requiring a separate database server. It is ideal for desktop applications (Electron, nw.js) or small Node.js services requiring a local, non-concurrent data store.

npm install whocallsthefleet-database
INSTALL
IMPORT
SIG · WHOCALLSTHEFLEET-D
W
whocallsthefleet-database
databasejavascriptv20240308.0.1
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.

Datastore
import Datastore from 'nedb'; // or '@seald-io/nedb'
const Datastore = require('nedb');
The `whocallsthefleet-database` package itself does not export symbols for direct database interaction; it provides the data files. You must import `Datastore` from `nedb` (or its maintained fork `@seald-io/nedb`) to interact with the database files provided by this package. ESM syntax is preferred in modern Node.js, while CommonJS `require` is also supported.
Datastore (with path)
import Datastore from '@seald-io/nedb'; const db = new Datastore({ filename: './node_modules/whocallsthefleet-database/db.json', autoload: true });
import { db } from 'whocallsthefleet-database';
To load the data from `whocallsthefleet-database`, you instantiate a `Datastore` from `nedb` (or `@seald-io/nedb`) and point its `filename` option to the actual data file within the installed `whocallsthefleet-database` package. The exact path might vary slightly based on your project structure and OS.
Promise API
import Datastore from '@seald-io/nedb'; const db = new Datastore({ filename: './node_modules/whocallsthefleet-database/db.json' }); await db.loadDatabaseAsync(); // Using the async/Promise API from @seald-io/nedb
db.loadDatabase(() => { /* callback style */ });
While the original `nedb` primarily uses callback-based APIs, the `@seald-io/nedb` fork provides a modern Promise-based (async/await compatible) API for all operations, which is the recommended approach for new development.

This quickstart demonstrates how to load the `whocallsthefleet-database` data files using `@seald-io/nedb` and perform basic query operations. It initializes a `Datastore` instance, loads the data automatically, and then fetches and logs documents.

import Datastore from '@seald-io/nedb'; // Use @seald-io/nedb for modern Promise API import path from 'path'; import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); // Determine the path to the database file provided by whocallsthefleet-database // This path assumes 'whocallsthefleet-database' is installed in node_modules const dbPath = path.join(__dirname, 'node_modules', 'whocallsthefleet-database', 'db.json'); async function loadAndQueryData() { try { // Initialize a new Datastore instance, pointing to the data file const db = new Datastore({ filename: dbPath, autoload: true // Automatically load the database on creation }); // Wait for the database to be loaded (autoload handles this implicitly, but explicit wait is good practice for persistence setup) // If not using autoload, you would call await db.loadDatabaseAsync(); console.log('Database loaded from:', dbPath); // Example: Find all documents in the database const allDocs = await db.findAsync({}); console.log(`Found ${allDocs.length} documents.`); // Example: Find documents matching a specific criteria (e.g., a 'name' field, assuming data structure) // Note: The actual fields depend on the 'Who Calls the Fleet' data schema. // This is a placeholder example. const exampleDoc = await db.findOneAsync({ 'id': 'some_kancolle_id' }); // Replace with actual query if (exampleDoc) { console.log('Example document found:', exampleDoc); } else { console.log('No document found with example ID.'); } // You can also count documents const count = await db.countAsync({}); console.log(`Total documents (counted): ${count}`); } catch (error) { console.error('Error interacting with the database:', error); } } loadAndQueryData();
Debug
Known issues
breakingThe GitHub repository for `whocallsthefleet-database` (TeamFleet/WhoCallsTheFleet-DB) was archived by the owner on December 20, 2024, and is now read-only. This indicates that the package providing this dataset is no longer actively maintained or developed. While data updates might still occur, the distribution method via this package or its source code will not receive further changes or bug fixes.
fix
Users should be aware that future compatibility issues or bugs related to the package's structure might not be addressed. Consider extracting the underlying JSON data for custom processing if long-term stability or active development is crucial.
affects: >=20240308.0.1
gotchaThe underlying NeDB project (louischatriot/nedb) is considered abandoned, with no new features or active maintenance since 2017. While it remains functional for basic use cases, users are strongly encouraged to use actively maintained forks like `@seald-io/nedb` for better stability, modern API features (Promises), and ongoing bug fixes.
fix
Install `@seald-io/nedb` instead of `nedb` and update your import statements: `import Datastore from '@seald-io/nedb';`.
affects: *
gotchaNeDB is an embedded database designed for small datasets and primarily operates in-memory for performance. While it supports persistence to a file, it does not offer robust concurrency control or support for multi-process environments. Each process will have its own copy of the database, making data synchronization complex and prone to issues.
fix
For concurrent access, multi-user applications, or large datasets, consider migrating to a dedicated database solution like MongoDB (due to API similarity) or PostgreSQL. For single-process, local data storage, ensure only one instance accesses the database file at a time.
affects: *
gotchaNeDB uses an append-only file format for persistence, which can lead to larger file sizes over time. Automatic compaction occurs upon database loading, but manual compaction might be necessary for specific performance or storage requirements.
fix
If file size becomes a concern, especially after numerous updates/deletes, ensure your application reloads the database periodically or explicitly calls `db.persistence.compactDatafile()` (or `db.compactDatafileAsync()` in `@seald-io/nedb`) to compact the data file. Note that manual compaction requires pausing other operations.
affects: *
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'find')
The `Datastore` instance was not properly initialized or the database failed to load, leading to methods like `find` or `findOne` being called on an undefined object. This often happens if `autoload` is false and `loadDatabaseAsync()` wasn't called or awaited, or if the `filename` path is incorrect.
fix
Ensure the `filename` option points to a valid path for the NeDB data file (e.g., `path.join(__dirname, 'node_modules', 'whocallsthefleet-database', 'db.json')`) and that `autoload: true` is set, or explicitly call and `await db.loadDatabaseAsync()` before performing any operations.
Error: Could not load database, it was already loaded.
Attempting to call `loadDatabaseAsync()` or rely on `autoload: true` on a `Datastore` instance that has already loaded its data.
fix
Avoid calling `loadDatabaseAsync()` multiple times. If `autoload: true` is used in the constructor, the database loads once, and subsequent calls are unnecessary. For programmatic control, initialize the `Datastore` once and then use its methods without re-loading.
Error: unique constraint violated
Attempting to insert a document with a value for an indexed field that has a unique constraint, where that value already exists in another document.
fix
Before inserting, check if a document with the conflicting unique field value already exists. Alternatively, handle the error gracefully or remove the unique constraint if it's not strictly required for your data model. Ensure your `ensureIndexAsync` calls correctly define unique constraints.
Upgrade
Version history
20240308.0.1latest on npm
Audit
Dependencies
nedbrequiredRuntime dependency for interacting with the database files. The `whocallsthefleet-database` package provides the data, and `nedb` provides the database engine. Consider using `@seald-io/nedb` for active maintenance.
@seald-io/nedboptionalRecommended actively maintained fork of NeDB, providing modern features and bug fixes. Can be used as a drop-in replacement for the original `nedb` package.
Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
2
Meta
1
Resources