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 🙏

© 2025 – Pkg Stats / Ryan Hefner

enemene

v0.5.10

Published

An opinionated approach to a powerful and easy to handle express web server.

Readme

Enemene ✨

Introduction

Enemene is a highly opinionated framework to quickly develop a classic REST API. It is based on Node.JS and Express and uses Sequelize for database connections. The term "Enemene" is a very stupid idea, but I like it. It comes from the german audio play "Bibi Blocksberg" for children. Bibi is a child witch who helps herself or others with the help of spells, and these spells always follow the format " Enemene something, some other thing rhyming with something. Hex Hex!", e.g. "Enemene Maus, Lampe gehe aus. Hex Hex!" ('Enemene mouse, lamp go out!"). As you see, enemene is the magic word here. That's why its used for the CLI in this framework.

Installation

npm install enemene

First configuration

Enemene.create(config)              // Create new server
.then(server => {
    server.setup(routers, views)    // Inject all routers and views to the server
        .then(() => {
            server.start();         // Start the server
    });
});

Concepts

Entities

Entities are the definition of models. You can create them by executing enemene mentity on the command line. Annotate a class property with @Field, @Reference, @Collection or @Composition to create a field. To add a calculated attribute that gets evaluated on-the -fly, annotate a class method with @Calculated.

Views

Views build an abstraction layer to the data. A view is defined as a class with an ID and the entity it is based by using @ViewDefinition. To limit the access granted by this view to a subset of fields, these can be defined in the view by their name or (with complex fields like references or collections) with a sub-view (use @ViewField). Only the fields defined in the view will be included in GET responses and available for setting in PUT/POST requests. Additionally, you can limit the objects accessible by the view by providing a filter (see " Filters"). Additionally, a user who performs actions with this view must have a ViewPermission allowing the corresponding action. You can create a rudimentary view by executing enemene miew on the command line. Here is an example for a basic view:

@ViewDefinition("5ee1bb90-7d28-4ba0-9ee4-f9bcdbbe002e", () => MyEntity)
class MyEntityView extends View<MyEntity> {

    @ViewField(0)
    attribute: string;
    
    @ViewField({
        position: 1,
        subView: MySecondView,
    })
    collectionAttribute: MySecondView[];
} 

Controllers

If a simple data access layer does not suffice, you can define custom controllers that provide custom routes. Here is an example:

@Controller("example")
export class ExampleController extends AbstractController {

    @Get("/:id")
    async getStuff(@Path("id") id: string, 
                   @CurrentUser user: User): Promise<string> {
        // ...
        return id;
    }
}

You can inject parameters into every route handler function. See the reference (TBD) for more info on what can be injected.

Filters

Filters can be defined and used for views or in custom route handlers. Define a filter by using Filter:

Filter.and(
    Filter.equals("firstName", "Anton")
    Filter.not(
        Filter.exists("role", 
            Filter.equals("name", "Developer")
        )
    )
)
// = Find all where firstName is "Anton" and the role is not the one called "Developer".