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.
@tgwf/gridintensity-polyfill
Advanced tools
A polyfill to for carbon-aware design. Adds a gridintensity API to user agents.
A polyfill, to build awareness of carbon intensity into javascript programs - move your code through time and space for greener digital products.
The dream is for this to be built into the browser, so we learn as web makers to do the right thing by default, and incorporate carbon-aware practices into how we work. Partly inspired by the work by Michelle Thorne and Yulia Startsev on Firefox Eco Mode concepts and sustainablity engineering, and by Lucia Ye's recent work on Onlign OS, and David Sykes work on the energy onion model, and Auke Hoekste's work on energy systems as ecosystems
import GridIntensity from '@tgwf/grid-intensity-polyfill'
// initialise
grid = GridIntensity()
const carbonIndex = await grid.getCarbonIndex()
if (carbonIndex == 'low') {
// Huzzah! Energy is cheap! The wind is blowing and the sun is out,
// the cost of energy is low, and the grid is also greener
// than normal. Do network and CPU intensive stuff
loadrichImages()
await Promise.all([
doExpensiveOperation(), preLoadVideo()
])
} else {
// Eep - our grid is relying on more fossil fuels than usual, so
// let's defer work til later, and serve a lighter weight experience
// by default
loadLiteImages()
// if we have web workers available, let give them a job to do when
// grid intensity is lower, so when the user comes back they have the
// richer experience
queueJobforWorker([
doExpensiveOperation
fetchVideo
])
}
There's a public demo in the github repo, to try this out. Run these commands after checking the code to see it
npm run build
cp ./lib/gridintensity.browser.js ./lib/gridintensity.browser.min.js ./public
npx run serve public
We know that the internet runs on electricity. That electricity comes from a mix of energy sources, including wind and solar, nuclear power, biomass, fossil gas, oil and coal and so on,
We call this the fuel mix, and this fuel mix can impact on the carbon intensity of your code.
Because the fuel mix will be different depending when and where you run your code, you can influence the carbon intensity of the code you write by moving it through time and space - either by making it run when the grid is greener, or making it run where it's greener, like a CDN running on green power.
This API is designed to make that easier. It pulls data from open data sources, about the predicted carbon intensity of energy on the grid where code is run, and presents an object you can query, so you can make an application or website serve a different experience to end users based on the carbon intensity.
This is very incomplete. Sorry about that. I hope this gives an idea of where you can help if you're interested.
user-agents
of change!FAQs
A polyfill to for carbon-aware design. Adds a gridintensity API to user agents.
The npm package @tgwf/gridintensity-polyfill receives a total of 0 weekly downloads. As such, @tgwf/gridintensity-polyfill popularity was classified as not popular.
We found that @tgwf/gridintensity-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
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.