npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

file-tree-view

v0.1.0

Published

A package for visualizing file trees generator.

Downloads

3

Readme

file-tree-view

file-tree-view is a Node.js package designed to generate and visualize file tree structures. It helps you display and interact with file and directory hierarchies in a clear and organized manner.

Features

  • Generate File Trees: Create a visual representation of your directory structure.
  • Easy Integration: Simple to include in your Node.js applications.
  • Flexible Usage: Supports various directory paths and structures.

Installation

You can install file-tree-view from npm. Run the following command:

npm install file-tree-view

Example Script

Here's a complete example script showing how to use file-tree-view to generate and visualize a file tree. This script includes configuration options to customize the file tree generation.

const path = require("path");
const fileTreeView = require("file-tree-view/dist").default;

// Define the root directory for the file tree
// You can customize root path
const root = path.join(__dirname);

// Configuration object for fileTreeView
const config = {
  rootPath: root, // The root directory to generate the file tree from
  projectName: "file-tree-view", // The name of your project
  // Optional configuration start
  ignoreDir: [
    // Default skip directories -> node_modules, .git, file-tree-view
    path.join(root, "directory_name"), // Directories to ignore
  ],
  saveAs: {
    html: false, // Whether to save the file tree as an HTML file
    htmlPath: "", // Path to save the HTML file if `html` is true
    json: false, // (Default) Whether to save the file tree as a JSON file
    jsonPath: "", // Path to save the JSON file if `json` is true
  },
};

// Generate and visualize the file tree
fileTreeView(config);

⚠️ Warning: Important Usage Instructions

When generating a file, make sure to call the function responsible for this task. After the file generation is complete, remember to disable the function to avoid unintended operations. Failure to follow these steps may lead to unexpected behavior or performance issues.