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

deceit

v1.2.0

Published

Designed for making mock REST servers and mimicking complex data relationships. Good for replacing heavy development environments and growing applications quickly.

Downloads

6

Readme

DECEIT


Deceit is made for mimicking REST services and complex data relationships. Deceit replaces heavy development environments and helps applications grow quickly.

DECEITFUL SERVERS & GENERATORS


Deceit currently has two main utilities:

The first is creating serviced REST endpoints quickly. Deceitful services can use any REST verb and automate parameter injection for handler functions.


// This runs a server with an 
// endpoint which concats strings.
deceit.serve({
    "/concat": function(prefix, suffix){ 
        return prefix + suffix 
    }
});

The second is generating mock data. Deceitful generators can mimic objects of arbitrary complexity. They can also simulate relationships between objects (eg. shared database keys).


// generates 50 "Names"
var names = deceit.gen([{
    first: /[A-Z][a-z]{4,7}/,
    last: /[A-Z][a-z]{4,7}/,
    middle: /[A-Z]/
}, 50])

Documentation


Rudimentary documentation for Deceit is hosted here. Better documentation complete with examples and samples should arrive soon. For now, use the file "test.js" in the deceit module as a reference for creating intricate templates.

MOTIVATION & USE CASES


I created Deceit to speed up the development of client-side code which interacts with large servers. Most client-side software depends on information retrieved from servers, so testing the client-side code requires running servers. Often, those servers are in turn dependent on other servers and databases. So, testing new UI features requires configuring and running a full stack of software.

Deceit aims to replace sprawling server environments with lightweight, self-contained facsimiles. Test data for client-side code doesn't need to be persistent across sessions- it just needs to follow the same patterns that real data would. So, Deceit provides compact, expressive tools for generating plausible data and serving it.

There are a few situations where these "deceitful servers" can boost productivity:

  • When building new apps, deceitful servers can be extended to experiment with new REST routes in minutes. Servers retrieving data from persistence layers are, with good reason, less nimble.

  • Alternatively, deceitful servers can save time on configuration. If switching between projects often, system settings and version conflicts can become time-sinks. Deceitful servers are agnostic to these needs, and can even run in parallel.

  • Building on the last example, deceitful servers are portable. They run anywhere Node does, and can be transferred quickly. Collaborators can share and run code more easily on more devices using deceitful servers.

INSTALLATION


Deceit is best used as a local npm package:

> npm install deceit --save

FUTURE PLANS


Deceit is very young and still growing. More documentation is a priority and should arrive shortly. There are also plans to add more built-in templates using Chance.js, build in configurable chaos for robustness testing, and refine the template process.

If you have any feature requests, get in touch- I'm sure others will find those same features helpful.

LICENSE


Deceit is free to use on an MIT license!