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

yode-server

v0.2.4

Published

a simple command-line http server with web-framework and cms

Downloads

9

Readme

Yode-server

NPM

Setup

First, install MongoDB and Memcached and run both

Yode-server also requires node.js version 0.10 and above

Also we need Imagemagick for operations above images

mkdir yode
cd yode
npm install yode-server
npm start yode-server

Usage

The installer creates www directory. Or you can choose another name during installation. This is where your projects to be placed. In www/localhost you’ll find a sample project.

All backend files are located in www/localhost/modules,

all static files (css, images, browser-js) are in www/localhost/static,

html-templates are in www/localhost/view

Each new project requires separate directory inside www. The name of project directory must be same as host name. For example: if your project hostname is www.example.com the path should be www/www.example.com

Command

npm start yode-server

or

node server

starts all virtual hosts located in project directory. If you need to start only one of them, specify it:

node server -p www.example.com

run yode-server as daemon:

node daemon

Admin interface

Admin panel default access (don't forget to add the port number in case it's not 80):

http://localhost/admin/
login: yeti
pass: 111111

Hello world (easy)

// file: www/localhost/modules/hello.js

// the pattern of a yode-module
// object "server" contents connections to mongodb, memcached and has more useful properties 
exports.Plugin = function(server) {
    this.server = server;
}

exports.Plugin.prototype.helloWorld = function(req, callback, auth) {
    callback('Hello World!')
}

in the browser http://localhost/hello:helloWorld/

Hello world (MVC)

Model code

// file: www/localhost/modules/models/hello.js

exports.Plugin = function(server) {
    this.server = server;
}

// as in the previous example but an object has passed to the callback.
exports.Plugin.prototype.getHello = function(req, callback, auth) {
    callback({text: 'Hello World!'})
}

View, template code

<!-- 

file: www/localhost/view/hello.tpl

uses jqtpl engine 

-->
<h1>${text}</h1>

Controller code

// file: www/localhost/modules/hellomvc.js

exports.Plugin = function(server) {
    this.server = server;
}

exports.Plugin.prototype.helloWorld = function(req, callback, auth) {
    
    var me = this
    me.server.getModel('models.hello').getHello(req, function(data, e) {
        me.server.tpl('hello.tpl', data, function(code) {
            callback(code);
        })
    })
}

See the result: http://localhost/hellomvc:helloWorld/

You can also use the model as REST-service in external apps: http://localhost/models.hello:getHello/

"Hello World" on CMS virtual pages

  1. Log into admin interface: http://localhost/admin/ (yeti:111111)
  2. Go to Start -> Site tools -> Pages
  3. Click (+) icon
  4. Enter page name
  5. Select template
  6. Click [Add] - button (in right-bottom panel Page blocks)
  7. Enter hellomvc:helloWorld to field Content type
  8. Save

Now you can see your "Hello World" on the new page (the path is in the second column of pages tree in admin-panel)