Socket
Book a DemoInstallSign in
Socket

directree.js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

directree.js

Create directory trees with files and content

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

directree.js

Create directory trees with files and content

Build Status Greenkeeper badge

Install

npm install directree.js

Usage

const directree = require('directree.js')

directree({
  '.gitignore': 'node_modules',
  'README.md': '# my project',
  'index.js': 'module.exports = () => "hello"',
  'spec': {
    'index.spec.js':'const hello = require("../index");',
  },
});

Pass file tree representation as a simple json object to directree(json, root).

Keys are used as file/dir name. If the value is of type string type, a file will be created. If value is an object, directory will be created.

We can optionally pass root directory. If not passed "." is used as default.

FAQs

Package last updated on 17 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.