Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@loopback/context
Advanced tools
LoopBack uses Context to manage state and dependencies in your application.
LoopBack implements the concept of a Context to represent a global registry in your application to manage config, state, dependencies, classes, etc. Context also serves as an IoC container used to inject dependencies into your code.
$ npm install --save @loopback/context
// app level
const app = new Application(); // `app` is a "Context"
app.bind('hello').to('world'); // ContextKey='hello', ContextValue='world'
console.log(app.getSync('hello')); // => 'world'
Dependency injection using context
const Application = require('@loopback/core');
const app = new Application();
app.bind('defaultName').to('John'); // setting context
class HelloController {
// consider this.ctx here
constructor(@inject('defaultName') name) { // injecting dependency using context
this.name = name;
}
greet(name) {
return `Hello ${name || this.name}`;
}
}
For additional information, please refer to the wiki.
IBM/StrongLoop is an active supporter of open source and welcomes contributions to our projects as well as those of the Node.js community in general. For more information on how to contribute please refer to the Contribution Guide.
Run npm test
from the root folder.
See all contributors.
MIT
FAQs
Facilities to manage artifacts and their dependencies in your Node.js applications. The module exposes TypeScript/JavaScript APIs and decorators to register artifacts, declare dependencies, and resolve artifacts by keys. It also serves as an IoC container
The npm package @loopback/context receives a total of 0 weekly downloads. As such, @loopback/context popularity was classified as not popular.
We found that @loopback/context demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.