
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Folk.JS is a simple Dependency Injection (DI) Container for Javascript/Node.
Install with npm
npm install folkjs --save
Or yarn
yarn add folkjs
Folk.JS was created to be simple. At minimun, At minimum, you need to do 3 things:
const Container = require('folkjs');
// Create a DI container
const container = Container();
// Create a factory function
// Argument is the current Container resolver
const makeUserService = ({ db }) => {
return {
create: (user) => db.insert(user);
}
};
// Constants are registered as a Container.CONSTANT by default
const container = require('connString', 'localhost');
// Functions are registered as a Container.FACTORY by default
const DBFactory = ({ connString }) => {
return new Database(connString);
};
// To register Function as a Constant...
container.register('fetch', fetch, Container.CONSTANT);
container.register('UserService', makeUserService);
container.register('db', DBFactory);
// To resolve use `resolve`
const UserService = container.resolve('UserService');
// OR
const UserService2 = container.draw.UserService;
// To register several modules:
container.register({
number1: 10,
number2: 42,
});
console.log(container.draw.number2) // Outputs: 42
Felipe J. L. Rita @felipelopesrita
FAQs
A simple dependency injection container
We found that folkjs 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.