
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
TreeForge is a lightweight, dependency-free JS package to render and manage ASCII-based file trees inside browser editors, sandboxes, or learning tools. It supports interactivity + CRUD actions, while remaining agnostic of the data source (local JSON or A
A lightweight, dependency-free JavaScript package for rendering file trees with style.
npm install treeforge
Add the TreeForge UI stylesheet to your HTML:
<!-- Option 1: Direct link (CDN) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeforge@1.0.2/styles/ui.css">
<!-- Option 2: From node_modules -->
<link rel="stylesheet" href="node_modules/treeforge/styles/ui.css">
<!-- Option 3: Import in JS (with bundler) -->
<script>
import 'treeforge/styles/ui.css';
</script>
import TreeForge, { ConfigPresets } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: { name: 'root', type: 'folder', children: [] },
...ConfigPresets.GITHUB_CLONE // That's it!
});
Output:
📁 root
└── (empty folder)
import { TreeStyles } from 'treeforge';
settings: TreeStyles.GITHUB // GitHub style
settings: TreeStyles.VSCODE_DARK // VS Code dark
settings: TreeStyles.DRACULA // Dracula theme
settings: TreeStyles.NORD // Nord theme
// ... and 11 more!
import { ConfigPresets } from 'treeforge';
...ConfigPresets.GITHUB_CLONE // GitHub browser
...ConfigPresets.VSCODE_CLONE // VS Code editor
...ConfigPresets.FILE_MANAGER // File manager
...ConfigPresets.DOCS_BROWSER // Documentation
// ... and 11 more!
hooks: {
onCreateFile: (path) => {},
onDeleteFile: (path) => {},
onReadFile: (path) => {},
onWriteFile: (path, content) => {},
// ... and 6 more!
}
import TreeForge from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: {
name: 'my-project',
type: 'folder',
children: [
{ name: 'src', type: 'folder', children: [] },
{ name: 'README.md', type: 'file' }
]
}
});
import TreeForge, { TreeStyles } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
settings: TreeStyles.VSCODE_DARK // Beautiful VS Code style!
});
import TreeForge, { ConfigPresets } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
...ConfigPresets.FILE_MANAGER // Includes: style, features, shortcuts, menus!
});
import TreeForge, { ConfigPresets, RestApiHooks } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
...ConfigPresets.VSCODE_CLONE,
onLoad: async () => {
const res = await fetch('/api/tree');
return await res.json();
},
hooks: RestApiHooks // Pre-built REST API hooks!
});
import TreeForge, { TreeStyles, LocalStorageHooks } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
settings: TreeStyles.GITHUB,
hooks: LocalStorageHooks // Auto-save to localStorage!
});
// TreeForge class (default export)
import TreeForge from 'treeforge';
// Everything else (named exports)
import {
TreeStyles, // 15 visual styles
ConfigPresets, // 15 complete configs
LocalStorageHooks, // Pre-built hooks
RestApiHooks, // Pre-built hooks
combineHooks, // Utility functions
getPreset,
mergePresets
} from 'treeforge';
import TreeForge, {
// Styles & Presets
TreeStyles, // 15 visual themes
ConfigPresets, // 15 complete configurations
// Hook Examples
LocalStorageHooks, // Save to localStorage
RestApiHooks, // Connect to REST API
AnalyticsHooks, // Track events
ValidationHooks, // Validate operations
CacheHooks, // Cache file content
AutoSaveHooks, // Auto-save with debounce
combineHooks, // Combine multiple hooks
// Utilities
getPreset, // Get specific preset
mergePresets, // Merge presets
listPresets, // List all presets
createConfig, // Create custom config
validateConfig, // Validate config
// References
SettingsReference,
EditorConfigReference,
TreeDataStructure
} from 'treeforge';
mds/ docs folder.| Style | Theme | Usage |
|---|---|---|
MINIMAL | Basic | TreeStyles.MINIMAL |
GITHUB | GitHub | TreeStyles.GITHUB |
VSCODE_DARK | VS Code Dark | TreeStyles.VSCODE_DARK |
VSCODE_LIGHT | VS Code Light | TreeStyles.VSCODE_LIGHT |
COLORFUL | Vibrant | TreeStyles.COLORFUL |
MATERIAL_DARK | Material Dark | TreeStyles.MATERIAL_DARK |
MATERIAL_LIGHT | Material Light | TreeStyles.MATERIAL_LIGHT |
ASCII | Terminal | TreeStyles.ASCII |
ASCII_COMPACT | Compact | TreeStyles.ASCII_COMPACT |
MONOCHROME | B&W | TreeStyles.MONOCHROME |
SOLARIZED_DARK | Solarized | TreeStyles.SOLARIZED_DARK |
DRACULA | Dracula | TreeStyles.DRACULA |
NORD | Nord | TreeStyles.NORD |
ONE_DARK | One Dark | TreeStyles.ONE_DARK |
HIGH_CONTRAST | Accessible | TreeStyles.HIGH_CONTRAST |
| Preset | Best For | Usage |
|---|---|---|
MINIMAL | Simple trees | ConfigPresets.MINIMAL |
GITHUB_CLONE | Repo browser | ConfigPresets.GITHUB_CLONE |
VSCODE_CLONE | Code editor | ConfigPresets.VSCODE_CLONE |
FILE_MANAGER | File operations | ConfigPresets.FILE_MANAGER |
DOCS_BROWSER | Documentation | ConfigPresets.DOCS_BROWSER |
MEDIA_BROWSER | Photos/videos | ConfigPresets.MEDIA_BROWSER |
CODE_EDITOR | Code playground | ConfigPresets.CODE_EDITOR |
TERMINAL_STYLE | CLI aesthetic | ConfigPresets.TERMINAL_STYLE |
COMPACT | Sidebar | ConfigPresets.COMPACT |
ACCESSIBLE | Screen readers | ConfigPresets.ACCESSIBLE |
MOBILE_OPTIMIZED | Touch devices | ConfigPresets.MOBILE_OPTIMIZED |
LARGE_DATASET | 10,000+ files | ConfigPresets.LARGE_DATASET |
COLLABORATIVE | Team workspace | ConfigPresets.COLLABORATIVE |
READ_ONLY | View-only | ConfigPresets.READ_ONLY |
DRACULA_THEME | Dracula colors | ConfigPresets.DRACULA_THEME |
NORD_THEME | Nord colors | ConfigPresets.NORD_THEME |
hooks: {
onCreateFile: (path, parentNode) => {}, // File created
onCreateFolder: (path, parentNode) => {}, // Folder created
onDeleteFile: (path, node) => {}, // File deleted
onDeleteFolder: (path, node) => {}, // Folder deleted
onDeleteNode: (path, node) => {}, // Any node deleted
onRenameNode: (oldPath, newPath, node) => {},// Node renamed
onReadFile: (path, node) => 'content', // Read file
onWriteFile: (path, content, node) => {}, // Write file
onLoad: () => treeData, // Load data
onFileOpen: (path, content, node) => {} // File opened
}
import TreeForge, { ConfigPresets } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
...ConfigPresets.GITHUB_CLONE
});
import TreeForge, { ConfigPresets } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
...ConfigPresets.VSCODE_CLONE
});
import TreeForge, { TreeStyles, LocalStorageHooks } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
settings: TreeStyles.DRACULA,
hooks: LocalStorageHooks
});
import TreeForge, { ConfigPresets, TreeStyles } from 'treeforge';
const tree = new TreeForge({
containerId: 'tree',
localData: myData,
...ConfigPresets.FILE_MANAGER, // Full features
settings: TreeStyles.NORD // But use Nord theme
});
✅ Zero Dependencies - Pure vanilla JavaScript
✅ 15 Styles - Beautiful pre-built themes
✅ 15 Presets - Complete configurations ready to use
✅ 10 Hooks - Full control over CRUD operations
✅ Lightweight - <15KB minified
✅ Type Safe - TypeScript interfaces included
✅ Framework Agnostic - Works with React, Vue, Angular, vanilla JS
✅ Fully Documented - 1600+ lines of documentation
ISC © abmercy035
TreeForge - Render trees beautifully in 3 lines of code 🌲✨
FAQs
TreeForge is a lightweight, dependency-free JS package to render and manage ASCII-based file trees inside browser editors, sandboxes, or learning tools. It supports interactivity + CRUD actions, while remaining agnostic of the data source (local JSON or A
We found that treeforge demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.