Skip to content

my-archives/koa-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koa-npm

Require global npm module middleware for Koa.

Installation

$ npm install koa-npm

Example

var koa = require('koa');
var npm = require('koa-npm');
var app = koa();

app.use(npm(app));

app.use(function *() {
  this.body = 'npm@' + this.app.npm.version + '\n' + this.app.npmRootPath;
})

app.listen(3000);
console.log('listening on port 3000');

License

MIT

About

Require global npm middleware.

Resources

Stars

Watchers

Forks

Packages

No packages published