Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Documentation: http://alexeypetrushin.github.com/micon
Silent killer of dependencies and configs
Micon allows You easilly and transparently eliminate dependencies and configs. Usually, when You are building complex system following tasks should be solved:
By component I mean any parts of code logically grouped together.
Micon solves all these tasks automatically, and has the following price - You has to:
register(component_name, &initialization_block)
method for component initialization.inject(component_name)
to whire components toghether.lib/components
folder.That's all the price, not a big one, compared to the value, eh? It's all You need to know about it to use 95% of it, there are also 2-3 more specific methods, but they are needed very rarelly.
Techincally Micon is sort of Dependency Injector, but because of its simplicity and invisibility it looks like an alien compared to its complex and bloated IoC / DI cousins.
Install Micon with Rubygems:
gem install micon
Once installed, You can proceed with the examples below.
The project hosted on GitHub. You can report bugs and discuss features on the issues page.
require 'micon'
require 'logger'
# Registering `:logger` component.
micon.register(:logger){Logger.new STDOUT}
class Application
# Whiring the `:logger` component and application together.
inject :logger
# Now You can use `:logger` as if it's an usual class member.
def run
logger.info 'running ...'
end
end
# Running our application, type:
#
# ruby docs/basics.rb
#
# And You should see in the console something like this:
#
# [2011-08-16T19:09:05.921238 #24944] INFO -- : running ...
#
Application.new.run
It's hard to see advantages of Dependency Injection using trivial example, so this example is more complicated.
Let's pretend that we are building the Ultimate Web Framework, RoR Killer. There will be lot's of modules and dependencies, let's see how Micon can eliminate them.
We build our framework in two steps:
You can compare these two examples and see advantages of using Dependency Injection.
If You are interested in more samples, please take a look at the Rad SBS it's build using Micon.
FAQs
Unknown package
We found that micon 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.