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

node-leek

v1.0.3

Published

A library for interacting with LeekWars API.

Downloads

327

Readme

🥬 NodeLeek

Simple NodeJs client for LeekWars. Can update scripts, buy items and start fight.
NodeLeek support the WebSocket connection, so it can read notification and start boss fight.

const nodeLeek = new NodeLeekClient("Account", "Password");
await nodeLeek.login();
// Do stuff
await nodeLeek.close()

💚 NodeLeek connected !
🤠 PorteventRemote (5000 habs)
🥬 PorteAutomatique lvl.1 - 100 talents - ⚠️ 50 capitals to spend

Fight in garden :

let myLeek: PublicLeek = nodeLeek.leeks[0];
let opponent: Opponent;
let fightId: number;

[opponent, fightId] = await nodeLeek.startRandomSoloFight(myLeek.id);

console.log("Fighting : ", opponent.name);
console.log("Fight result : ", await nodeLeek.getCompleteFight(fightId));

Fight bosses :

const roomId = await nodeLeek.createRoom(1); // 1 for Nasu Samurai, 2 for Fennel King, 3 for Evil Pumpkin
// use await nodeLeek.joinRoom(roomId); to join the room with another account
await nodeLeek.startRoomFight();

Get started

Install NodeLeek from npm :

npm install node-leek

Routes supported

Uses OpenAPI to autogenerate API client (specifications are handwritten as no official uptodate spec exists). Check the OpenAPI specification.
So far only the most used route are supported, further support will come.

  • /farmer
    • /login : partially, some part of the response (such as chat message) aren't done yet
  • /garden
    • /get
    • /get-leek-opponnents/{leekId}
    • /get-farmer-opponnents/
    • /start-solo-fight
    • /start-farmer-fight
  • /fight
    • /get/{fightId}
  • /leek
    • /spend-capital
    • /get/{leekId}
  • /marker
    • /buy-habs-quantity
  • /ai-folder
    • /new-name
    • /delete
  • /ai
    • /save
    • /new-name
    • /delete
    • /sync

🔄 LeekSync (WIP)

LeekSync allows you to clone your LeekWars file on your local computer and sync them with a file watcher.
Open your favorite local IDE, edit some files and they get upload to LeekWars seamlessly.
If you happen to change your file locally while LeekSync is not running, or you edited file through LeekWars editor, LeekSync will ask you which source to use and update the other to be on the same page

Download your leekscripts

We recommend using const nodeLeek = new NodeLeekClient("Account", "Password", true); to start NodeLeek in read only mode. This will ensure no modification are done to your leekwars account. Once you downloaded your scripts and have a secured backup, you can remove this readonly flag.

  nodeLeek.syncWith("../my-files/", false, "leekwars")

You should see your own code in leekscripts folder. Here is an example :

leekscripts/
├── DamageCalculation
│   └── NaiveDamageCalculation.leek
├── MyFirstIa.leek
└── Test.leek

Upload your leekscripts

We strongly recommend to save your code, copying it or upload it to a Git repository
Uploading an empty folder will result in your leekwars account being just an empty folder.
Use LeekSync with care, and have a backup

First, we need to remove the readonly option to actually edit our leekwars account.
You can use the watch option to activate the watcher. It will listen to any modification done, and will automaticly push them to Leekwars.

  nodeLeek.syncWith("../my-files/", true, "leekwars")

Edit your file and refresh Leekwars to see the updated files :

Output

Help needed

❗ Uses outdated package https://www.npmjs.com/package/request because I couldn't make other OpenAPI codegen variants work with cookie authentification. This issue must be resolved to ensure a cleaner code