Install ag-Grid with NPM

Both ag-Grid Community and ag-Grid Enterprise are available as NPM packages, even if you don't intend to use them with a particular JavaScript framework. To install ag-Grid, run

npm install --save ag-grid-community

To install ag-Grid Enterprise, run:

npm install --save ag-grid-enterprise

Afterwards, depending on your project setup, you can either require or import the module. For ag-grid, you need the ag-grid module:

// ECMA 5 - using nodes require() method var AgGrid = require('ag-grid-community'); // ECMA 6 - using the system import method import {Grid} from 'ag-grid-community';

for ag-Grid Enterprise, you need to import ag-Grid first, and add ag-grid enterprise after it:

// ECMA 5 - using nodes require() method var AgGrid = require('ag-grid-community'); require('ag-grid-enterprise'); // ECMA 6 - using the system import method import {Grid} from 'ag-grid-community'; import 'ag-grid-enterprise';

After you have loaded the scripts, you should include the styles in your project. There are several ways to do it, depending on your module bundler and the specifics of your project. The stylesheet files reside in dist/styles/ directory of the ag-grid package - you should include ag-grid.css and the theme of your choice.