Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lark-router

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lark-router - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

.eslintrc.yml

7

examples/async.js

@@ -46,2 +46,8 @@ /**

});
router.get('/bar', async (req, res) => {
await new Promise(resolve => setTimeout(resolve, 1000));
res.body.push(Date.now());
await new Promise(resolve => res.end(res.body.join(', ') + '\n', resolve));
});
/*
router.get('/bar', (req, res) => new Promise((resolve, reject) => {

@@ -56,3 +62,4 @@ setTimeout(() => {

}));
*/
module.exports = http.createServer(router.routes()).listen(3000, () => debug('async http apps listening on 3000 ...'));

4

index.js

@@ -139,4 +139,4 @@ /**

route (method, pathexp, handler) {
debug('setting route for [' + method + '] [' + pathexp + '] ...');
assert('string' === typeof method, 'Method must be a string!');
debug('setting route for [' + method.toUpperCase() + '] [' + pathexp + '] ...');
method = method.toLowerCase();

@@ -174,3 +174,3 @@ assert(this._methods.includes(method), 'Invalid Method!');

this.emit('error', e, req, ...args);
throw e;
// throw e;
});

@@ -177,0 +177,0 @@ }

{
"name": "lark-router",
"version": "1.1.2",
"version": "1.2.0",
"description": "An koa route initialization and configuration module.",
"main": "index.js",
"engines": {
"node": ">=6.4.0"
"node": ">=7.6"
},
"scripts": {
"test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should --recursive test",
"_test": "./node_modules/.bin/mocha --require should test/"
"test": "./node_modules/.bin/eslint example/** lib/** && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should --recursive test",
"debug": "node --inspect-brk=9229 example/app.js"
},

@@ -36,3 +36,4 @@ "repository": {

"devDependencies": {
"istanbul": "^0.4.5",
"eslint": "^3.18.0",
"istanbul": "^1.1.0-alpha.1",
"koa": "^2.0.0-alpha.6",

@@ -39,0 +40,0 @@ "lodash": "^4.16.2",

@@ -104,2 +104,3 @@ lark-router

router.get('/', () => new Promise(...));
router.get('/foo', async () => { ... });
```

@@ -149,2 +150,3 @@

```
/main.as.index.js => /
/foo.as.param/bar.as.param.js => /:foo/:bar

@@ -151,0 +153,0 @@ /foo/bar.as.asterisk.js => /foo/:bar*

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc