
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
NOde Developing Assistant
noda is a very lower-level package which will help you easily accessing files and directories in your package or adjacent to your Node.js file.
const noda = require('noda');
const foo = noda.inRequire('util/foo');
// require <homedir>/util/foo.js
// Here <homedir> is home directory of current node.js package(module).
const bar = noda.osRequire('./foo/bar');
// require ./foo/bar/<platform>.js
// Here platform equals to the returned value of os.platform().
const lib = noda.requireDir('./lib');
// require all sub modules in ./lib and return a hash object
Before read APIs, please understand that
noda.* located.subpath refers to pathname relative to the basepath of "current package".Sync is omitted.noda.inRead() will read a file in current package.noda.nextRead() will read a file adjacent to current file.noda.bindings(string name)
Require an addon.node.
This method is allowed to be required as noda/bindings.
noda.packageOf(string id, Object module)
Return the object parsed from package.json which belongs to the special package named id according to the view angle of special module.
noda.currentPackage()
Return the object parsed from package.json which belongs to current package.
noda.once(Function action)
Run specified function immediately when the code is first time reached.
noda.inExists(string subpath, boolean resolveAsModule)
Judge whether file or directory exists. If resolveAsModule set true, subpath will be tentatively regarded as JS/JSON module path in the current package when the exact file not exists.
This method is synchronuous.
noda.inRead(string subpath [, string encoding, boolean nullIfNotFound ])
Read content of file.
noda.inReaddir(string subpath)
Read the contents of a directory.
noda.inRequire(string subpath)
Require js or json.
noda.inRequireDir(string dirname, Array | string ignores)
Based on requireDir(), but the dirname is regarded as relative path to home directory of the package in which the caller is located.
ignores includes those that SHOULD NOT be required. If '*/' contained in ignores, all sub directories will not be required whether or not index.js exists in the sub directories. If '*' contained in ignores, all .js files will not be required.
noda.inResolve(string subpath)
Resolve the subpath into an absolute path.
noda.nextRead(string subpath [, string encoding, boolean nullIfNotFound ])
Read content of file.
noda.osRequire(string dirname)
Require module whose name is same with the name of current platform. Relative dirname is acceptable.
noda.requireDir(string dirname, Array | string ignores)
Read the directory and require all javascript modules except those excluded, and returned them in an object with keys equal to modules' name. Relative dirname is acceptable.
ATTENTION:Directory "node_modules" is always ignored whether or not it is explictly added in ignores.
noda.upResolve(string pathname)
Find sub-directory or file in ascent directory and return the full path.
noda.downResolve(string pathname [, number depth, string order ])
Find sub-directory or file in descent directory and return the full path.
The value of order may be DFS (means depth-first search) or BFS (means breadth-first search).
noda.existsInPackage
Alias of noda.inExists.
noda.readInPackage
Alias of noda.inRead.
noda.requireInPackage
Alias of noda.inRequire.
noda.requireDirInPackage
Alias of noda.inRequireDir.
noda.resolveInPackage
Alias of noda.inResolve.
Suppose that there is an NPM package named ching:
+ ching
+ bin
+ command
+ lib
+ node_modules
+ util
. CHANGELOG.md
. conf.js
. index.js
. package.json
. README.md
Let's see what noda can do.
// FILE: ching/command/init/index.js
const noda = require('noda');
// Read ching/package.json and return the parsed JSON object.
noda.currentPackage();
// Require ching/util/rc.js and return.
noda.inRequire('util/rc');
FAQs
NOde Developing Assistant
The npm package noda receives a total of 1,339 weekly downloads. As such, noda popularity was classified as popular.
We found that noda 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.