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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jodit-nodejs

v1.0.16

Published

Jodit FileBrowser and Uploader connector for Node.js

Readme

Jodit Connector Application (Node.js)

CI/CD Documentation npm version License: MIT

Node.js/TypeScript implementation of the Jodit File Browser and Uploader connector.

Links:

Technology Stack

  • Node.js LTS (v18+)
  • TypeScript with strict typing
  • Express 5.x for REST API
  • Zod for runtime validation
  • @hapi/boom for error handling
  • Winston for logging
  • Jest + Supertest for testing

Installation

npm install jodit-nodejs

Quick Start

Basic Usage (TypeScript)

import { start } from 'jodit-nodejs';

// Start server with default config
const server = await start(8081);
console.log('Server running on http://localhost:8081');

Basic Usage (JavaScript)

const { start } = require('jodit-nodejs');

async function main() {
  const server = await start(8081);
  console.log('Server running on http://localhost:8081');
}

main().catch(console.error);

With Custom Configuration

import { start } from 'jodit-nodejs';

await start({
  port: 8081,
  config: {
    debug: false,
    allowCrossOrigin: true,
    sources: {
      uploads: {
        name: 'uploads',
        title: 'User Uploads',
        root: '/var/www/uploads',
        // NGINX or CDN base URL for accessing files
        baseurl: 'http://localhost:8080/uploads/'
      }
    }
  }
});

With Authentication

import { start, type AuthCallback } from 'jodit-nodejs';

const checkAuth: AuthCallback = async (req) => {
  const token = req.headers.authorization;
  if (!token) return 'guest';

  const user = await validateToken(token);
  return user.role; // 'admin', 'editor', 'guest', etc.
};

await start({
  port: 8081,
  config: {
    defaultRole: 'guest',
    accessControl: [
      { role: 'guest', FILES: true, FILE_UPLOAD: false },
      { role: 'admin', FILES: true, FILE_UPLOAD: true }
    ]
  },
  checkAuthentication: checkAuth
});

Security: POST-only Mode

For enhanced security, you can restrict the API to only accept POST requests:

import { start } from 'jodit-nodejs';

await start({
  port: 8081,
  config: {
    onlyPOST: true,  // Block all GET requests
    sources: {
      uploads: {
        name: 'uploads',
        title: 'User Uploads',
        root: '/var/www/uploads',
        baseurl: 'http://localhost:8080/uploads/'
      }
    }
  }
});

When onlyPOST is enabled:

  • All GET requests return 405 Method Not Allowed
  • Provides protection against CSRF attacks
  • Prevents parameter leakage in server logs

Documentation

📖 Complete Documentation - Full documentation with guides and API reference

Quick Links:

OpenAPI Specification:

Key Features

  • Full file management - browse, upload, rename, move, delete
  • Folder operations - create, rename, move, delete, tree view
  • Image processing - resize, crop, thumbnail generation
  • Document generation - PDF and DOCX from HTML
  • Access control - role-based permissions, path restrictions
  • Authentication - cookie, JWT, express-session support
  • Security - POST-only mode, CSRF protection
  • Express integration - standalone or integrate with existing apps
  • Custom storage - local filesystem, S3, Azure, Google Cloud, etc.
  • TypeScript - full type safety with strict typing
  • Validation - Zod schemas for runtime validation
  • Testing - comprehensive test suite with Jest + Supertest
  • Docker - multi-stage build for production deployment

Implemented Functions

  • actionFiles - get list of files
  • actionFileUpload - upload files
  • actionFileUploadRemote - upload file from remote URL
  • actionFileRemove - remove files
  • actionFileMove - move files
  • actionFileRename - rename files
  • actionFileDownload - download file
  • actionGetLocalFileByUrl - resolve local file by URL
  • actionFolderCreate - create folders
  • actionFolderRemove - remove folders
  • actionFolderMove - move folders
  • actionFolderRename - rename folders
  • actionFolders - get folder tree
  • actionPermissions - get permissions
  • actionImageResize - resize images
  • actionImageCrop - crop images
  • actionGenerateDocx - generate DOCX documents from HTML
  • actionGeneratePdf - generate PDF documents from HTML

Examples

Check the examples/ directory for complete working examples:

  • examples/basic-js.js - Simple server setup
  • examples/with-auth-js.js - With authentication callback
  • examples/with-cookie-auth.js - Cookie-based authentication
  • examples/with-jwt-auth.js - JWT token authentication
  • examples/with-express-session.js - Express-session integration

Scripts

npm run dev          # Development with hot reload
npm run build        # Compile TypeScript
npm start            # Run compiled application
npm test             # Run tests
npm run lint         # Check code quality

Docker

# Build and run
docker build -t jodit-nodejs .
docker run --rm -p 8081:8081 jodit-nodejs

# With custom config
docker run --rm -p 8081:8081 \
  -v /host/path/to/config.json:/usr/src/app/config.json \
  -v /host/path/to/files:/usr/src/app/files \
  jodit-nodejs

License

MIT