Socket
Socket
Sign inDemoInstall

directory-layout

Package Overview
Dependencies
9
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    directory-layout

Verifies directory layout for existence of files and folders in specified positions


Version published
Weekly downloads
7
increased by600%
Maintainers
1
Install size
1.62 MB
Created
Weekly downloads
 

Readme

Source

Directory Layout

npm version dependencies dev dependencies

Verify your build's directory layout


Project builds can be complex, and the size and structure of the final build directory may be equally complex. While unit testing helps to ascertain if code is intact, "Directory Layout Verifier" tests that the build has resulted in correct creation of files / directories at respective positions, which otherwise takes unnecessary time to debug in case the build failed partially.

Creation of directory structure is also automated, checkout our tests.

We've used markdown syntax to store the directory structure, easy for you to verify visually. Here's an example.

Installation

  • NPM: npm install -g directory-layout

Usage:

From the command line:

Usage: directory-layout [options] <path, ...>

Options:

-h, --help                                                 output usage information
-V, --version                                              output the version number
-g, --generate <path> <output-directory-layout-file-path>  Generate directory layout
-v, --verify <input-directory-layout-file-path> <path>     Verify directory layout

Example for directory layout generation:

$ directory-layout -g test/fixtures output.md
Generating layout for test/fixtures...

Layout generated at: output.md

Example for directory layout verification:

$ directory-layout -v output.md test/fixtures
Verifying layout for test/fixtures ...

Successfully verified layout available in output.md.

Within node:

For directory layout generation:

var DirectoryLayout = require('directory-layout');

DirectoryLayout
	.generate('test/fixtures/', {
		output: './test/output/layout.md',
		ignore: [
			'.DS_Store'
		]
	})
	.then(function() {
		console.log('Layout successfully generated');
	});

For directory layout verification:

var DirectoryLayout = require('directory-layout');

DirectoryLayout
	.verify('test/output/layout.md', {
		root: './test/fixtures'
	})
	.then(function() {
		console.log('Successfully resolved');
	})
	.catch(function(failures) {
		console.log('Failures found at: ');
		for (var i = 0; i < failures.length; i++) {
			console.log("- " + failures[i]);
		}
	});

grunt-directory-layout

If you are looking for the grunt plugin, head over to grunt-directory-layout, created by @ApoorvSaxena

Coming soon:

Gulp task

License

Copyright (c) 2016 Apoorv Saxena, http://apoorv.pro Licensed under the MIT license.

Keywords

FAQs

Last updated on 21 Apr 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc