
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
create-fs-tree
Advanced tools
Create a filesystem tree from a definition. This module is intended to use in unit/e2e tests to create a pre-determined fs trees.
You probably want to install this as an npm dev dependency:
npm install --save-dev create-fs-tree
Use it in your tests:
import {expect} from "chai";
import {createTree, destroyTree} from "create-fs-tree";
import {readFileSync} from "fs";
import {tmpdir} from "os";
import {join} from "path";
describe("my test subject", () => {
const dir = join(os.tmpdir(), "root");
before(() => {
createTree(dir, {
"file": "file content",
"other-file": Buffer.from("other-file content"),
"sub-dir": {
"sub-file": "sub-file content"
}
});
});
after(() => {
destroyTree(dir);
});
it("my test", () => {
expect(
readFileSync(join(dir, "file"))
).to.equal("file content");
});
});
Creates under the root
directory a fs tree as specified in the definition
.
WARNING:
createTree
removes theroot
directory before creating the specified fs tree.
root
string: root directory under which the fs tree is created. The
directory is created if it doesn't exist, it's emptied if it already existsdefinition
object: an object describing the fs tree to create. Its
properties' values can either be:
Nothing.
createTree("mydir", {
"level-0-file": Buffer.from("level-0-file content\n"),
"level-0-dir": {
"level-1-file": "level-1-file content\n",
"level-1-dir": {}
}
});
Creates a fs tree so that:
$ tree mydir
mydir
βββ level-0-file
βββ level-0-dir
βββ level-1-file
βββ level-1-dir
$ cat mydir/level-0-file
level-0-file content
$ cat mydir/level-0-dir/level-1-file
level-1-file content
Removes the root
Β path. Equivalent to rm -rf
.
root
string: path to removeNothing.
See CONTRIBUTING.
FAQs
Create a fs tree from a json definition
The npm package create-fs-tree receives a total of 140 weekly downloads. As such, create-fs-tree popularity was classified as not popular.
We found that create-fs-tree 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.