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

fidelizare-integrate

v0.6.3

Published

Asistent de integrare Fidelizare pentru softuri de gestiune si case de marcat. Scaneaza codul, gaseste locul potrivit si propune integrarea API-ului, in siguranta.

Readme

@fidelizare/integrate

Interactive CLI that integrates the Fidelizare loyalty API into a management / POS codebase. It scans the project, finds where the register detects a scanned code, and proposes the integration as a reviewed diff, applied only after you confirm. Modeled on how mature setup wizards (PostHog) work: a deterministic harness around an optional coding agent, with strict permissions.

Run

# visual demo on a bundled sample POS (no key, nothing real touched)
npx fidelizare-integrate --demo

# on a real project (deterministic, works offline)
cd /path/to/soft-de-gestiune
npx fidelizare-integrate

# agentic mode: a real tool-use coding agent (Opus 4.8 via OpenRouter)
export OPENROUTER_API_KEY=sk-or-...
npx fidelizare-integrate --agent

Flags: --demo, --dir <path>, --agent, --model <id> (default anthropic/claude-opus-4.8), --yes, --no-anim.

Two modes

  • Deterministic (default, no key): detect stack -> scan -> propose a helper + the call at the fidelity-card branch -> diff + confirm -> apply. Verified across Node, PHP, Python.
  • Agentic (--agent, OpenRouter): a real tool-use loop (src/core/agent-loop.js) where the model autonomously calls list_files / read_file / grep / create_file / insert_code / check_syntax / finish. Every write is gated by an opencode-style permission harness (y / a=always / N), cwd-jailed, secret-redacted, .bak backups.

Tests

npm test runs the suite (node --test): integration across Node/PHP/Python (with node --check, php -l, python -m py_compile), vault redaction, and the cwd-jail. All green.

What it does

  1. Hand-built ASCII intro + animations (logo sweep, codebase scan beam, spinners, progress) - all in src/ui/anim.js, zero animation libraries.
  2. Takes the API key into a secret vault (src/core/vault.js): the raw key never enters a diff or the agent's context; it is written only to .env host-side.
  3. Detects the stack (src/core/detect.js): C#/.NET, PHP, Delphi, Java, Python, Node.
  4. Scans (src/core/scan.js) for the safest integration point: where a scanned code is handled / the sale is finalized / a fidelity card is detected.
  5. Proposes a minimal change (src/core/propose.js, or agent.js with Opus): a helper file + the acumuleazaPuncte(codCard, items, total) call inserted exactly at the card-detection branch + the import.
  6. Renders a colored diff, checks git state, asks to confirm.
  7. Applies safely (src/core/apply.js): cwd-jailed, read-before-write, .bak backups, writes .env.

Safety (what it can and cannot do)

  • Only edits files inside the target project (cwd jail; refuses paths outside).
  • Read-before-write; .bak backup per edited file; warns if git is dirty / not a repo.
  • The API key is never written into source (verified) - only into .env.
  • The generated helper catches API errors so a failed call never blocks a sale.
  • Nothing is written until you confirm; node --check on the result passes (no broken code).

Verified

node src/cli.js --demo --no-anim --yes produces: a fidelizare.js helper, the call inserted in the isCardFidelitate branch of pos.js, the import added, .env with the key (absent from source), both files pass node --check, and the integrated POS runs end to end with a graceful API failure.