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.
package-config
Advanced tools
Get namespaced config from the closest package.json
Having tool specific config in package.json reduces the amount of metafiles in your repo (there are usually a lot!) and makes the config obvious compared to hidden dotfiles like .eslintrc
, which can end up causing confusion. XO, for example, uses the xo
namespace in package.json, and ESLint uses eslintConfig
. Many more tools supports this, like AVA, Babel, nyc, etc.
npm install package-config
{
"name": "some-package",
"version": "1.0.0",
"unicorn": {
"rainbow": true
}
}
import {packageConfig} from 'package-config';
const config = await packageConfig('unicorn');
console.log(config.rainbow);
//=> true
It walks up parent directories until a package.json
can be found, reads it, and returns the user specified namespace or an empty object if not found.
Returns a Promise
for the config.
Returns the config.
Type: string
The package.json namespace you want.
Type: object
Type: string
Default: process.cwd()
The directory to start looking up for a package.json file.
Type: object
The default config.
Type: boolean
Default: false
Skip package.json
files that have the namespaced config explicitly set to false
.
Continues searching upwards until the next package.json
file is reached. This can be useful when you need to support the ability for users to have nested package.json
files, but only read from the root one, like in the case of electron-builder
where you have one package.json
file for the app and one top-level for development.
Example usage for the user:
{
"name": "some-package",
"version": "1.0.0",
"unicorn": false
}
Pass in the config returned from any of the above methods.
Returns the file path to the package.json file or undefined
if not found.
FAQs
Get namespaced config from the closest package.json
The npm package package-config receives a total of 48,530 weekly downloads. As such, package-config popularity was classified as popular.
We found that package-config 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
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.