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

datatables.net-editor-server

v3.0.1

Published

NodeJS server-side libraries for DataTables

Readme

DataTables Node.js server-side libraries

This is a Node.js library to provide easy server-side support for DataTables - the Javascript table library.

These libraries provide support for:

  • Server-side processing - work with millions of rows
  • Editor - CRUD UI for DataTables
  • ColumnControl - Column search controls for DataTables
  • SearchBuilder - Complex search logic UI

The library is framework-agnostic and can be used in any web framework. It uses Knex.js to work with many different databases, including Postgres, MySQL, SQLServer and Sqlite.

Installation

Available on NPM, this package can be installed with:

npm install --save datatables.net-editor-serverdatatables.net-editor-server

There are two primary entry point classes in the library:

  • DataTable - for read only tables
  • Editor - for read / write tables, with Editor

There are also a number of supporting classes such as Options, Mjoin and more.

Quick Start

The database connection is a standard Knex object, configured to access your database.

The DataTables Node.js libraries expose both ESM and CJS modules and so can be loaded as appropriate for your software - e.g.:

import { Editor, Field, Format, Validate } from 'datatables.net-editor-server';

or

const { Editor, Field, Format, Validate } = require('datatables.net-editor-server');

The following shows an Express controller that makes use of the Editor class to handle all CRUD requests for a table with four columns defined. Validators and formatters are used were appropriate.

import { Editor, Field, Format, Validate } from 'datatables.net-editor-server';
import { Router } from 'express';
import db from '../db.js';

const router = Router();

router.all('/api/staff', async function (req, res) {
	let editor = new Editor(db, 'datatables_demo').fields(
		new Field('first_name').validator(Validate.notEmpty()),
		new Field('last_name').validator(Validate.notEmpty()),
		new Field('age')
			.validator(Validate.numeric())
			.setFormatter(Format.ifEmpty(null)),
		new Field('start_date')
			.validator(
				Validate.dateFormat(
					'YYYY-MM-DD',
					null,
					new Validate.Options().message(
						'Please enter a date in the format yyyy-mm-dd'
					)
				)
			)
			.getFormatter(Format.sqlDateToFormat('YYYY-MM-DD'))
			.setFormatter(Format.formatToSqlDate('YYYY-MM-DD'))
	);

	await editor.process(req.body);
	res.json(editor.data());
});

export default router;

Similarly, if your table is readonly, the DataTable and Column classes can be used (this will support DataTables' client-side or server-side processing modes):

import { DataTable, Column } from 'datatables.net-editor-server';
import { Router } from 'express';
import db from '../db.js';

const router = Router();

router.all('/api/staff', async function (req, res) {
	let table = new DataTable(db, 'datatables_demo').columns(
		new Column('first_name'),
		new Column('last_name'),
		new Column('age'),
		new Column('start_date')
			.getFormatter(Format.sqlDateToFormat('YYYY-MM-DD'))
	);

	await table.process(req.body);
	res.json(table.data());
});

export default router;

Documentation

For full documentation, please refer to the DataTables site.

License

MIT — see LICENSE for full text.