New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-dir-listing

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-dir-listing

Tool to generate JSON directory listings

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

json-dir-listing

Build Status Coverage Status

Tool for creating a file that contains the contents and types of everything in the directory.

Options

  • -d, --dryrun - Run through the process without actually creating any new files
  • -R, --recursive - Recursively create listings for all subfolders
  • -o, --output [name] - Specify the name to use for the file output (default .listings.json)
  • -s, --sparse [depth] - Create listings that only contains n [depth] of children (default null)
  • -b, --basepath [root] - Root for generated relative path (default '.')

Example

  1. mkdir tmp
  2. touch tmp/test.txt
  3. json-dir-listing tmp/
  4. Creates tmp/.listings.json containing
{
  "path":"tmp",
  "name":"tmp",
  "type":"folder",
  "children":[{
    "path":"tmp/test.txt",
    "name":"test.txt",
    "type":"file"
  }]
}

Why?

I wanted to create a dynamic client-only website as my personal CV/blog/whatever, but I didn't want it become bloated with the content itself so I decided to dynamically load and render all the content. The setup I was using doesn't allow directory listings, but allows file access so I created this to get a list of all files in a directory.

Keywords

FAQs

Package last updated on 17 Feb 2016

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc