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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tfilemonk

v0.0.6

Published

to rapidly build prototypes that are ready for mongodb

Downloads

7

Readme

tfilemonk

use monk(mongodb-wrapper) storing to file for rapid prototyping

Purpose

The most important phase in each an every project is the start. The start should be as fast as possible. The most projects fail, even before they started. In IT-projects, it is important to get ready and show something. I want you to show something very fast, without even setting up a database. I want you to start coding, before even setup the database. The solution can be this module.

this module

This module is connecting two great modules. monk and mongo-mock. mongo-mock is simulating an API mostly compatible to the original mongodb, but store data in memory. This data can be persisted to filesystem in a js file.

usage:

require('tfilemonk')({filename: __dirname+'/data.js'});
const monk = require('monk');

(async () => {
    const db = monk('mongodb://localhost:1231/database');
    const users = db.get('users');
    await users.insert({ name: "tobias" });
    const tobias = await users.findOne({ name: "tobias" });
    monk.persist();
    console.log('done');
    process.exit();
})().catch(err => console.log(err));

disclosure

This module is meant to be used in development, specially when starting a project. You can start using this mongo replacement and later just switch to a real mongo database. Without changing any code, just configure the database and get rid of this module.

I made this module for monk, because I love that module. It has a very clean API. If you want to use the more popular mongoose, no extra module is needed, you can directly use mongo-mock and call mongo-mocks method _persist.

roadmap

  1. It would be good to use different mongo-mock to store in multiple files, but mongo-mock is implemented as a singleton now.
  2. use mongo-mock for given collections, so you could try a new feature first within a temporary database instead of polluting the shared database.

PRs are welcome