# grunt-stubcell

> grunt tool for stubcell

Latest version **0.7.0** (published 2014-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-stubcell
pnpm add grunt-stubcell
yarn add grunt-stubcell
bun add grunt-stubcell
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2014-08-24 |
| First published | 2014-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yosuke-furukawa |
| Maintainers | yosuke-furukawa |
| Keywords | grunt, stub, stubcell |

## Links

- npm: https://www.npmjs.com/package/grunt-stubcell
- Repository: https://github.com/yosuke-furukawa/grunt-stubcell
- Issues: https://github.com/yosuke-furukawa/grunt-stubcell/issues
- npm.io page: https://npm.io/package/grunt-stubcell

## Dependencies (1)

- [stubcell](https://npm.io/package/stubcell.md) ^0.7.0

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@jsdevlab/zod](https://npm.io/package/@jsdevlab/zod.md) — 0 weekly downloads
- [@jsdevlab/valibot](https://npm.io/package/@jsdevlab/valibot.md) — 0 weekly downloads
- [n8n-nodes-ecom-adspy-tco](https://npm.io/package/n8n-nodes-ecom-adspy-tco.md) — 0 weekly downloads

## Recent versions

- 0.7.0 (latest) — 2014-08-24
- 0.6.0 — 2014-07-14
- 0.5.4 — 2014-05-28
- 0.5.3 — 2014-05-27
- 0.5.2 — 2014-05-27
- 0.5.1 — 2014-05-26
- 0.4.1 — 2014-05-24
- 0.3.1 — 2014-05-16
- 0.3.0 — 2014-05-15
- 0.2.0 — 2014-05-10
- 0.1.2 — 2014-04-28
- 0.1.1 — 2014-04-28

## README

grunt-stubcell
--------------

grunt task runner for stubcell.

[stubcell](https://github.com/yosuke-furukawa/stubcell) is stub server that can be  defined response JSON as JSON5.

How to use
--------------


## 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:

```sh
$ npm install grunt-stubcell -D
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-stubcell');
```

*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-coffee/tree/grunt-0.3-stable).*

## Configure

```js
'use strict';
  grunt.initConfig({
    stubcell: {
      test: {
        // entry yaml path
        entry: "entry.yaml",
        // base response data path
        // if empty, basepath is same to entry.yaml dir
        basepath: "",
        // port settings
        port: 3000,
        // record json settings
        record: {
          // backend server for record json
          target : "http://echo.jsontest.com",
          // json store directory
          basepath : "",
          // debug print
          debug : true,
        }
      }
    }
  });
  grunt.loadNpmTasks('grunt-stubcell');

```


## Use with grunt-connect-proxy

```js
'use strict';
grunt.initConfig({
  connect: {
    server: {
      options: {
        port: 8000,
        base: 'public',
        logger: 'dev',
        hostname: 'localhost',
        middleware: function (connect, options) {
          var proxy = require('grunt-connect-proxy/lib/utils').proxyRequest;
          return [
            // Include the proxy first
            proxy,
            // Serve static files.
            connect.static(options.base),
            // Make empty directories browsable.
            connect.directory(options.base)
          ];
        }
      },
    },
    // proxy settings for stubcell
    proxies: [
      {
        context: '/api',
        port: 3000,
      }
    ],
  },
  stubcell: {
    test: {
      // entry yaml path
      entry: "entry.yaml",
      // base response data path
      // if empty, basepath is same to entry.yaml dir
      basepath: "",
      // port settings
      port: 3000,
      // record json settings
      record: {
        // backend server for record json
        target : "http://echo.jsontest.com",
        // json store directory
        basepath : "",
        // debug print
        debug : true,
      }
    }
  }
});
grunt.loadNpmTasks('grunt-stubcell');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-connect-proxy');

grunt.task.run([
  // configureProxies is needed
  "configureProxies",
  "connect",
  "stubcell",
  "watch"
]);

```

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