# grunt-module-graph

> Grunt task for obtaining the dependency graph from ES6 modules

Latest version **0.0.3** (published 2014-06-03) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install grunt-module-graph
pnpm add grunt-module-graph
yarn add grunt-module-graph
bun add grunt-module-graph
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2014-06-03 |
| First published | 2014-05-29 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.x |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Juan Dopazo |
| Maintainers | juandopazo |
| Keywords | grunt, ecmascript, es6, AST, dependency, dependencies, analizer |

## Links

- npm: https://www.npmjs.com/package/grunt-module-graph
- Repository: https://github.com/juandopazo/grunt-module-graph
- Issues: https://github.com/juandopazo/grunt-module-graph/issues
- npm.io page: https://npm.io/package/grunt-module-graph

## Dependencies (1)

- [module-graph](https://npm.io/package/module-graph.md) ^0.1.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2014-06-03
- 0.0.2 — 2014-06-03
- 0.0.1 — 2014-05-29

## README

grunt-module-graph
==================

[![Build Status](https://travis-ci.org/juandopazo/grunt-module-graph.svg?branch=master)](https://travis-ci.org/juandopazo/grunt-module-graph)
[![Dependency Status](https://gemnasium.com/juandopazo/grunt-module-graph.svg)](https://gemnasium.com/juandopazo/grunt-module-graph)
[![NPM version](https://badge.fury.io/js/grunt-module-graph.svg)](http://badge.fury.io/js/grunt-module-graph)

Grunt task to generate a JSON file with the dependency tree in ES6 module files.

Getting Started
---------------
This plugin requires Grunt `~0.4.0`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out
the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains
how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as
install and use Grunt plugins. Once you're familiar with that process, you may
install this plugin with this command:

```shell
npm install grunt-module-graph --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with
this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-module-graph');
```

The module graph task
---------------------

Run this task with the `grunt module-graph` command. This will generate a JSON
file with all the dependencies of each module specified as a task `src`.

Task targets, files and options may be specified according to the grunt
[Configuring tasks](http://gruntjs.com/configuring-tasks) guide.

Usage example
-------------

### Recommended

```js
grunt.initConfig({
  'module-graph': {
    production: {
      src: ['src/*.js'],
      dest: 'dist/dependencies.json'
    }
  }
});
```

Running this task will generate a file that looks like this:

```json
{
  "module1": ["module2"]
}
```

### Including named imports/exports

Alternatively you can get more information from all you source files by using
the `includeBindings` option:

```js
grunt.initConfig({
  'module-graph': {
    production: {
      options: {
        includeBindings: true
      },
      src: ['src/*.js'],
      dest: 'dist/dependencies.json'
    }
  }
});
```

Chosing this option will generate an output file similar to:

```json
{
  "module1": {
    "imports": {
      "module2": ["someImport", "anotherImport"]
    },
    "exports": ["somethingExported"]
  }
}
```

License
-------

This software is free to use under the Yahoo Inc. BSD license.
See the [LICENSE file][] for license text and copyright information.

Contribute
----------

See the [CONTRIBUTING file][] for info.


[CONTRIBUTING file]: https://github.com/juandopazo/grunt-module-graph/blob/master/CONTRIBUTING.md
[LICENSE file]: https://github.com/juandopazo/grunt-module-graph/blob/master/LICENSE.md

---
_Source: https://npm.io/package/grunt-module-graph · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
