
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@github-docs/data-directory
Advanced tools
Recursively load a directory of YAML, JSON, and Markdown files into a JavaScript object.
A Node.js module to recursively load a directory of YAML, JSON, and Markdown files into a JavaScript object.
npm install @github-docs/data-directory
Given the following file tree:
$ tree data
data
├── bar.yaml
├── foo.json
└── nested
└── baz.md
and the following content in each file:
$ cat foo.json
{"meaningOfLife": 42}
$ cat bar.yaml
another_markup_language: 'yes'
$ cat nested/baz.md
I am markdown!
then running this code:
const path = require('path')
const dataDirectory = require('@github-docs/data-directory')
const data = dataDirectory(path.join(__dirname, 'data'))
will return this object:
{
bar: { another_markup_language: 'yes' },
foo: { meaningOfLife: 42 },
nested: { baz: 'I am markdown!' }
}
This module exports a single synchronous function dataDirectory
that returns
an Object.
dataDirectory(directory, [options])
directory
String (required) - Full path to the directory to read.options
Object
extensions
Array - A case-insensitive array of filenames to load. Defaults to ['.json', '.md', '.markdown', '.yaml', '.yml']
ignorePatterns
Array - Filename patterns to ignore. Every value in the array must be a regular expression. Defaults to [/README\.md$/i]
. To include README.md
files in your data object, specify an empty array: []
.preprocess
Function - A function that can be used to modify each loaded file's content before it's added to the data object. Default is a no-op function that return the unmodified content: (content) => { return content }
FAQs
Recursively load a directory of YAML, JSON, and Markdown files into a JavaScript object.
We found that @github-docs/data-directory 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.