A simple way to install tables + editor with npm

A simple way to install tables + editor with npm

sdroulerssdroulers Posts: 43Questions: 14Answers: 0

Hi,

I just wanted to share you a straightforward way I found to install tables & editor (licensed version) in npm.

Using the download builder, I pick the options I want and then choose to download the files (with concatenate option)

I then:
* Copy the Datatable package into some local directory.
* Add a package.json file with the following

{
  "name": "datatables-bundle",
  "version": "1.10.16",
  "description": "Datatables bundled",
  "main": "datatables.js",
  "author": {
    "name": "SpryMedia Ltd",
    "url": "http://datatables.net"
  },  
}
  • Go to my project directory.
  • Call npm install ../datatables-local-package-path.

Once this is done, I can require the bundled package with a single line:

 window.dt = require('datatables-bundle');

... and this works. Editor and Tables are fully functional so are the plugins I use.

It spares me the difficulty of installing separately all the npm packages (I just require one file), the post install process for Editor's licence and so on.

So far I don't see downsides but this can be due to my ignorance about npm. Of course the package won't update by itself but this is a minor issue.

Sébastien

Answers

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Awesome - thanks for sharing this!

    Allan

  • sdroulerssdroulers Posts: 43Questions: 14Answers: 0

    My pleasure :)

This discussion has been closed.