
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
json-file-structure
Advanced tools
Clean and simple JavaScript project for turning JSON objects into directory and file structures.
"json-file-structure" was created to create file & directory structures from a JSON definition
const JSONtoFiles = require('json-file-structure);
let destination = 'dist';
let data = [
{
name: "index.html", // required
content: "<h1 id=\"header\">Home Page</h1>"
},{
name: "about.html", // required
content: "<h1 id=\"header\">About Page</h1>"
},{
name: "assets", // required
children: [ // required for directories
{
name: "projects.json", // required
content: "{\"projects\":[]}"
},
{
name: "images", // required
children: [] // required for directories
}
]
}
]
JSONtoFiles(destination,data);
- dist/
- index.html
- about.html
- assets/
- projects.json
- images/
json-file-structure
can create both directories and files. Below are the required fields for each.
Directories are created when an object has a children
key with a value type of array. This array can be empty but it MUST exist for a directory to be created. You can nest directories
{
name: "images", // required
children: [] // required
}
Files are created if the object has a name
. However content
is optional.
{
name: "test.txt", // required
}
FAQs
Clean and simple JavaScript project for turning JSON objects into directory and file structures.
We found that json-file-structure 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.