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

alchemymvc

v1.4.0-alpha.8

Published

MVC framework for Node.js

Downloads

108

Readme

Getting started

You can create a new, empty app by executing this npm command:

npm init alchemy your-app-name

Then npm install the package.json contents. This is only alchemymvc by default.

Installation

Just installing the npm package can be done like this:

$ npm install alchemymvc

Quick start guide

You can find all the documentation on https://alchemy.elevenways.be

Base class

Most Alchemy classes inherit from the Base class (which in turn inherits from the Informer class, a custom event emitter class)

Here are some important static methods:

Base.setProperty([key,] getter, setter)

This will create a property getter/setter on the class. For example:

MyClass.setProperty(function test_me() {
  return 'test!'
});

Will create a property getter called 'test_me' that will always return the string "test!"

var instance = new MyClass();
instance.test_me;
// »»» "test!"

Base.setMethod([key,] fnc)

This will add a method to the class. For example:

MyClass.setMethod(function testMe() {
  return 'test!'
});

Now you can call this method:

var instance = new MyClass();
instance.testMe();
// »»» "test!"

Models

Creating a server-side model is easy, you need to inherit from the Alchemy.Model.App:

var Block = Function.inherits('Alchemy.Model.App', function Block(conduit, options) {
  Block.super.call(this, conduit, options);
});

Model schema

After that you probably want to define the schema to use, that has to be done in a constitute call:

Block.constitute(function addFields() {

  // Add a simple unique string field
  this.addField('name', 'String', {unique: true});

  // Another string field, that is not unique
  this.addField('title', 'String');

  // Longer piece of text
  this.addField('content', 'Text');
});

By default 3 fields are already added to the schema:

  • _id: An ObjectID field
  • created: A datetime field with the creation date
  • updated: A datetime field that gets updated whenever the record is saved

Authors

AlchemyMVC is developed at Eleven Ways, a team of IAAP Certified Accessibility Specialists.