Security News
RubyGems.org Adds New Maintainer Role
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.
environment
Advanced tools
Provides node's `process.env` object functionality as stand-alone functions instead of a C++ fake object that does weird things. As an added bonus, if running node with Proxies enabled ("node --harmony") it also exports a function that creates an `Environment` object that is similar to `process.env` but behaves like a real object.
Provides node's process.env
object functionality as stand-alone functions instead of a C++ fake object that does weird things. As an added bonus, if running node with Proxies enabled ("node --harmony") it also exports a function that creates an Environment
object that is similar to process.env
but behaves like a real object.
npm install environment
Mostly self-explanatory:
If Proxy
is available, due to running node using the --harmony
flag, a constructor is exported as well which allows the creation of Environment
objects.
These objects aren't entirely normal JavaScript objects, but they're much closer than node's process.env
. Environment.prototype
doesn't inherit from Object.prototype
but it does have most of the functions from it. toString
, valueOf
, isPrototypeOf
, hasOwnProperty
, as well as constructor
pointing to Environment
.
It's possible to add methods to Environment.prototype
and have them work on instances correctly. It's possible to change an instance's __proto__
and point it to something else and also have that work correctly (though Object.getPrototypeOf may not reflect the change).
// normal creation
var env = require('environment').create();
// or modifying the prototype
var Environment = require('environment');
Environment.prototype.paths = function paths(){
return this.PATH.split(process.platform === 'win32' ? ';' : ':');
}
var env = new Environment;
console.log(env.paths());
FAQs
Check which JavaScript environment your code is running in at runtime: browser, Node.js, Bun, etc
The npm package environment receives a total of 3,335,849 weekly downloads. As such, environment popularity was classified as popular.
We found that environment demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.