
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
gengojs-wrappify
Advanced tools
An Express, Hapi, an Koa wrapper for the core of gengojs. This module should be used for test purposes only.
An Express, Hapi, an Koa wrapper for the core of gengojs. This module should be used when you need to test your gengojs plugins that need or use the request object.
The following is an example that shows you to:
Note that there are two version of Wrappify. One is without es6 and the other is.
The example below is with ES6. Therefore, make sure to use the --harmony flag
when running your tests or use Babel to convert your ES6 code to ES5.
var assert = require('chai').assert;
var core = require('gengojs-core');
var header = require('your plugin path');
// Wrappify with harmony
// (without harmony would simply be require('gengojs-wrappify'))
var wrappify = require('gengojs-wrappify/es6');
describe('Header', function() {
describe('load plugins', function() {
it('should exist', function() {
// Create an instance of the core.
var gengo = core({}, header());
gengo.plugins.headers.forEach(function(plugin) {
assert.isDefined(plugin);
assert.strictEqual(plugin.package.type, 'header');
assert.strictEqual(plugin.package.name, 'gengojs-default-header');
});
});
});
describe('koa', function() {
var gengo = core({}, header());
var koa = require('koa');
var app = koa();
// Use Koa wrapper
app.use(wrappify(gengo).koa());
var request = require('supertest');
it('should have the api exposed internally', function() {
request(app.listen()).get('/').end(function() {
assert.isDefined(gengo.header);
assert.isDefined(gengo.header.getLocale);
});
});
});
describe('express', function() {
var gengo = core({}, header());
var express = require('express');
var app = express();
var request = require('supertest');
// Use Express wrapper
app.use(wrappify(gengo).express());
it('should have the api exposed internally', function() {
request(app).get('/').end(function() {
assert.isDefined(gengo.header);
assert.isDefined(gengo.header.getLocale);
})
});
});
describe('hapi', function() {
var gengo = core({}, header());
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({
port: 3000
});
// Register Hapi wrapper
server.register(wrappify(gengo).hapi(), function(err) {});
it('should have the api exposed internally', function() {
server.inject('/', function(res) {
assert.isDefined(gengo.header);
assert.isDefined(gengo.header.getLocale);
})
});
});
});
FAQs
An Express, Hapi, an Koa wrapper for the core of gengojs. This module should be used for test purposes only.
The npm package gengojs-wrappify receives a total of 2 weekly downloads. As such, gengojs-wrappify popularity was classified as not popular.
We found that gengojs-wrappify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Google’s UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.