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

anchordb-angular

v1.3.2

Published

Angular and Ionic bindings for AnchorDB — NgModule, DI, RxJS, and SQLite storage ready after one install.

Readme

anchordb-angular

Angular and Ionic bindings for AnchorDB — the same module and injection shape as @nestjs/mongoose, with SQLite storage ready after one install.

Overview · Report a bug or get support

npm install anchordb-angular

That single command brings the database and the Capacitor SQLite driver, and in a browser — ng serve, ionic serve, a PWA — the app is ready. A native build needs one more line, below. provideAnchorIonic picks the right storage for wherever the app is running:

import { provideAnchorIonic, provideAnchorFeature } from "anchordb-angular";

bootstrapApplication(AppComponent, {
  providers: [
    ...provideAnchorIonic({ name: "contacts" }),
    ...provideAnchorFeature([{ name: "Contact", schema: ContactSchema }]),
  ],
});

Capacitor SQLite on a device, IndexedDB under ionic serve and in a PWA. Every Ionic app needs that switch, because the Capacitor plugin's web build requires jeep-sqlite plus a WASM asset a plain ionic serve does not have — so choosing wrong fails only in the browser, or only on a device.

ionicAdapter(name) is exported separately if you want the adapter without the providers, and an explicit adapter in the config still wins, so tests can pass a MemoryAdapter.

In a Capacitor app

Capacitor links native plugins only from your app's own package.json. @capacitor-community/sqlite arrives through anchordb-angular, so it is installed — but npx cap sync leaves it out of the Android and iOS projects. List it once:

npm install @capacitor-community/sqlite
npx cap sync

Keep the plugin on the major that matches your @capacitor/core: 6.x for Capacitor 6, 7.x for 7, 8.x for 8. anchordb-angular declares both with wide ranges (>=6) so npm reuses your app's versions instead of nesting copies — two @capacitor/core instances do not see each other's plugins.

Skip the step and provideAnchorIonic throws on the device, naming those two commands. It does not fall back to IndexedDB: that would keep your data in a store the app abandons the moment the plugin is linked, which looks exactly like data loss.

NgModule apps

@NgModule({
  providers: [
    ...AnchorModule.forRoot({ name: "my-app" }).providers,
    ...AnchorModule.forFeature([{ name: "User", schema: UserSchema }]).providers,
    ...provideAnchorService(),
  ],
})
export class AppModule {}

@Injectable({ providedIn: "root" })
export class UserService {
  readonly users$: AnchorObservable<User[]>;
  readonly status$: ReturnType<AnchorService["syncStatus$"]>;

  constructor(@Inject("AnchorService") anchor: AnchorService) {
    this.users$ = anchor.find$<User>("User", { age: { $gt: 18 } }, { sort: "-createdAt" });
    this.status$ = anchor.syncStatus$();
  }
}

Providers use string tokens — "AnchorService", ANCHOR_DB, getModelToken(name) — because this package never imports Angular, so it cannot create an InjectionToken. Inject them with @Inject.

forRoot / forFeature / getModelToken mirror @nestjs/mongoose deliberately: a developer moving between a NestJS backend and an Ionic app writes the same wiring in both places.

Observables

find$, findOne$, count$, aggregate$, syncStatus$ and on$ return an AnchorObservable, which satisfies the RxJS contract structurally — including the Symbol.observable interop hook — so from(...), the async pipe, toSignal() and every RxJS operator work on it.

Why Angular is not imported

@angular/core and rxjs are optional peer dependencies and are never imported. Two reasons: the package must install cleanly for React Native users who will never touch Angular, and a copy of Angular compiled into a library can disagree with the app's own — the classic "two copies of @angular/core" failure.

Providers are therefore plain objects that your app passes to its own NgModule or bootstrapApplication, using its own Angular.

Storage on Ionic

| Target | Adapter | | --- | --- | | ionic serve, PWA | anchordb/storage/indexeddb | | iOS / Android native | anchordb/storage/capacitor-sqlite |

Status

1.2.0. @angular/core and rxjs stay optional peer dependencies and are never imported by this package.

The Capacitor adapter has never run on a device — this machine has no simulator. The platform switch in ionicAdapter, including the unlinked-plugin error, is unit-tested, and the IndexedDB side is covered by the shared storage conformance suite; what is unverified is the native driver plumbing. Test a create-read-restart cycle on a device early.

MIT.

The AnchorDB family

Six packages. Only anchordb is required — the rest exist so that an offline-only app never has to download Express, and an Express server never has to download React.

| Package | What it is | Runs where | | --- | --- | --- | | anchordb | The database — schema, models, queries, aggregation, optional sync | phone · browser · Node | | anchordb-react | React and React Native hooks | the device | | anchordb-angular (this package) | Angular / Ionic module, DI and RxJS observables | the device | | anchordb-sync-server | Server half of sync — Express, NestJS, Next.js | your backend | | anchordb-relay | Dev relay for the Anchor Lens inspector | your laptop | | anchordb-lens-link | Open a QA build's database in Anchor Lens on the same phone, from a file | the device, in QA builds |

Each one needs a different third-party framework as a peer dependency, and npm resolves those per package rather than per import — which is why they are not one package. Full reasoning and API reference: github.com/knnadeera/anchordb.

Bugs, support and feedback

Report a bug, ask for help or suggest a feature on the AnchorDB project page — choose anchordb-angular as the package, and the reply comes by email.

Include the version (npm ls anchordb), where it runs, the smallest snippet that reproduces it, and the full error.