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

gdk

v1.0.0

Published

global based frameworks

Downloads

12

Readme

GDK

GDK is a global based framework for node.

Installation

$ npm install gdk

Features

  • No export And require.
  • NO third-module.
  • Micro enough.
  • Flat.
  • Support command.
  • Support Cluster Mode.
  • Locked global error,never shut down.

Docs & Community [[all building]]

  • http://creativision.cn
  • http://guapijs.com
  • http://guapijs.cn

Quick Start

No.GDK dose not support quick start.And I will not provide a generator.

I don't think less is best.I can guide you to make your our service different with anyone.

At First make sure that your env is in your project and you npm installed gdk.

You can download Learning Project.

1.Create bin File to guide - bin/start.js

require('gdk')

var baseDir  = __dirname;
gdk.load(gdk.c.path.join(baseDir,'../config'));

gdk.boot();

gdk.load(gdk.c.path.join(baseDir,'../http'));

gdk.cluster(function(){
    gdk.http.boot();
});

2.Create config File - config/index.js

var baseFile = __filename;
gdk.updatePath.config = baseFile;

gdk.config.Mcores = true;
gdk.config.errLog = gdk.c.path.join(__dirname,'../err.log');
gdk.config.port = 3000;

3.Create http base - http/index.js

gdk.updatePath.http = __filename;
gdk.http = {};

gdk.load(gdk.c.path.join(__dirname,'./router'));
gdk.load(gdk.c.path.join(__dirname,'./flow'));
gdk.load(gdk.c.path.join(__dirname,'./instance'));

4.Create flow file - http/flow/index.js

gdk.http.flow = function(req,res){
  if(gdk.http.router[gdk.c.url.parse(req.url).path]){
    gdk.http.router[gdk.c.url.parse(req.url).path](req,res);
  }else{
    res.end();
  }
}

5.Create router file - http/router/index.js

gdk.http.router = {};

gdk.http.router['/'] = function(req,res){
  res.end('Hello World!');
}

6.Create instance file - http/instance/index.js

gdk.http.server = function(req,res){
    gdk.http.flow(req,res);
};

gdk.http.boot = function(){
    var server = gdk.c.http.createServer(gdk.http.server);
    server.on('error',function(err){
        gdk.errCatch('server err',err);
    });
    server.listen(gdk.config.port);
};

7.Run

node bin/start.js

Command

1.bash command

Example:

bash---console.log(gdk.config)

2.Hot-update command

Example:

update---config

Example2:

upfile---/node/http/index.js

3.Your command

Example:

gdk.runTime.print = function(info){
  console.log(info)
}
print---here is a test

Cluster message I/O

In gdk Cluster mode.gdk.cluster(cb).cb will always run on workers.

Workers can use process.send to call a runtime function in all workers or master.

Example:

gdk.runTime.print = function(a,b){
  console.log(a+b)
}

process.send({bash:'print',arg:{'hello',' world'}});

Example:

gdk.runTime.MainCore = function(a,b){
  console.log(a+b)
}
  
process.send({bash:'MainCore',arg:{'hello',' world'},Master:true});