Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
read-cortex-json
Advanced tools
The thing cortex uses to read cortex.json files or fallback to read cortex configurations from package.json
The thing cortex uses to read cortex.json files or fallback to read cortex configurations from package.json.
Cortex supports both cortex.json
and the 'cortex'
field of package.json
. But with read-cortex-json
, you don't have to care about all this, and you should ALWAYS use this module to read and save cortex.json
.
npm install read-cortex-json --save
var cortexJson = require('read-cortex-json');
path
current working directoryfunction(err, json)
Error
Object
Reads and returns the information of a cortex package.
cortexJson.read('/path/to/your/repo', function(err, json){
if (err) {
console.error('There was an error', e);
return;
}
console.log('The package data is:', json);
});
This method is different from cortexJson.read()
that it will validate some stuff and flavors the object with some default values which cortex registry needs.
Cleans and validate the json
.
This method will check the json
object first. If it is an old object, cortexJson.clean
will santitize it.
After cortexJson.clean()
and cortexJson.enhanced()
, there are always
main
, if no main entry found, it will be false
css
, if no csses found, it will be []
entries
, if no entries found, it will be []
.cortex.main
will be require.resolve()
d. That is, if there is a index.js
, but cortex.main
is 'index'
, and after enhanced()
, cortex.main
will be 'index.js'
.cortex.css
and cortex.entries
will always be an globbed array(even an empty array) after enhanced()
main
, css
, or entries
, is explicitly defined but not found, an error will throw.main
, css
, nor entries
, an 'CORTEX_NO_ENTRY'
error will throw.in the json
data.
It is a cortexJson.extra()
then cortexJson.clean()
function(err)
Save the json to the file.
function(root)
Traverses up from the cwd
and gets the first directory that contains a package file of cortex.
Sometimes user might run cortex commands inside the subtle directories of the current repo, and we must make sure cortex commands always run at the root directory.
String
package namepath
cache directory of the current profilefunction(err, document)
json
Gets the cached document.
FAQs
The thing cortex uses to read cortex.json files or fallback to read cortex configurations from package.json
We found that read-cortex-json 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.