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

nameless

v1.0.7

Published

MVC Framework

Downloads

39

Readme

nameless (beta) -- Easy MVC sync Framework

INSTALLING

via npm

  • npm install nameless
  • You're done!

from source

  • git clone https://github.com/StarmanMartin/nameless.git
  • cd nameless
  • npm install

via cli

What is nameless

Nameless is a sync Model-View-Controller framework. It is developed after the pattern of Ruby on Rails. The developing with nameless is based on the convention over configuration pattern. Nameless covers three data storage, routing and socket connections. Nameless uses Fiber to synchronise the function calls. For routing Nameless uses express.js.

#Controller

To manage the routing nameless provides a controller method. All your controllers have to be in the controller directory inside your project. The name of the controller file has to be as followed: NAME_controller.js (replace NAME by your controller name). To register a controller add the following to your app.js: (!important add it between the "controller Start" and "controller End" commends)

  1. name of the controller
  2. a prefix. to change Controllers URL -> prefix/controller_name/method (optional)
  3. list of routes.
 app.controller(name[, prefix], routeList);
/********* Controller Start **************/
app.controller('user', ['index', 'post#login', 'getuser/:id->get<-showuser']).root();
app.controller('team', 'intern', ['post#create']);
/********* Controller End **************/

Route

Routes get registert via the route list parameter. The pattern to register a route is: [HTTP METHOD]#[URL]->[CONTOLLER METHOD]<-[VIEW] for example:

'del#del/:teamId/:id->createUser<-success'

The Routing rules:

  • Default HTTP method is GET
  • The view ist just a file name and not a path (path/to is not allowed)
  • The <-[view] part is not needed if the view has the same name as the controller method
  • The [URL]-> is not needed if the url is prefx/controller_name/method
  • If the URL is the same but one parameter the folowing syntax can be used:
app.controller('user', ['user:id']);

You can use the nameless-cli tool to handle all routes.

Controller properties

Controllers have four important properties.

  • First one is the model which is a reference to the model with the same name (if existing).
  • Second is the getModel which is a getter to get a reference to all other models.
  • Third is the getSocket to get a socket by id or list of socket in a specified room.
  • Fourth is the wait() function witch has to be be called on external async functions.
  • Fifth is the run witch is the same as the thread.run function.
controller.user = function(req, res, thread){
 var thisModel = this.model.new() // Referenz of the model object with the same name
 // thisModel is a new model-object already saved in the MySQL DB 
 this.getModel('name') // To get other Models
 
 res.redirect = '/home'; // Redirects client to new URL after next() got called
 var parameter = { name: 'No name'};
 res.render('Path/to/jade', parameter); // Renders a view and send to client
 res.callController('controller.method', parameter); // calls	another Controller
 
 
 // To call async functions, call the wait mathod of the controller. After your 
 // async function has returned call the threads run method;
 setTimeout(function(){
   // Returns to the last wait.
   thread.run(true) //The Parameter will be the return value of the wait method
 }, 1000); 
 
 this.wait(); // Makes the Contoller Wait. Gives the V8 interpreter Thread free.
}

config/db


To use nameless all MySQL data has to be set. Just fill in user and password information at the config/db.json.

SORRY REST IS COMING UP SOON