# ninjs-rjs

> requirejs build wrapper

Latest version **0.0.35** (published 2016-11-12) · AGPL-1.0 license · 0 weekly downloads

## Install

```sh
npm install ninjs-rjs
pnpm add ninjs-rjs
yarn add ninjs-rjs
bun add ninjs-rjs
```

Provides the command `ninjs-rjs`.

## 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.0.35 |
| Published | 2016-11-12 |
| First published | 2016-10-07 |
| Weekly downloads | 0 |
| License | AGPL-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stuart J. MacKenzie |
| Maintainers | smack |
| Keywords | ninjs, rjs |

## Links

- npm: https://www.npmjs.com/package/ninjs-rjs
- Repository: https://github.com/snapptop/ninjs-rjs
- Homepage: git+https://github.com/snapptop/ninjs-rjs.git#readme
- Issues: https://github.com/snapptop/ninjs-rjs/issues
- npm.io page: https://npm.io/package/ninjs-rjs

## Dependencies (2)

- [requirejs](https://npm.io/package/requirejs.md) ^2.3.2
- [ninjs-lodash](https://npm.io/package/ninjs-lodash.md) ^0.1.61

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.35 (latest) — 2016-11-12
- 0.0.34 — 2016-11-08
- 0.0.33 — 2016-11-08
- 0.0.32 — 2016-10-29
- 0.0.28 — 2016-10-28
- 0.0.27 — 2016-10-28
- 0.0.26 — 2016-10-27
- 0.0.25 — 2016-10-27
- 0.0.24 — 2016-10-26
- 0.0.23 — 2016-10-26
- 0.0.22 — 2016-10-24
- 0.0.21 — 2016-10-18
- 0.0.20 — 2016-10-18
- 0.0.19 — 2016-10-18
- 0.0.18 — 2016-10-18
- … 17 more at https://npm.io/package/ninjs-rjs/versions

## README

# ninjs-rjs

*requirejs build utils*

---

## Overview

This module includes common requirejs utility methods that fall into the following groupings:

- Compiling/Optimizing/Obfuscating js
- Dynamic UI Generators

> We tried to keep it as tiny as possible with as few dependencies as possible.
```json
{
  "dependencies": { "ninjs-lodash": "^0.1.56", "requirejs" : "^2.3.2" },
  "bundleDependencies": [],
  "peerDependencies": {},
  "devDependencies": {},
  "optionalDependencies": {}
}
```

---

## Setup

### Install

Install the module locally and add to ./package.json dependencies

```sh
npm install --save ninjs-rjs
```

### Import

```js
const _ =    require('ninjs-lodash')
const rjs = require('ninjs-rjs')
```

### $ettings

Override/Add your own $ettings

- Create a ./.ninjs/settings.js(json) file within a module cwd that exports an object
- You can now access that object (and nested props) via _.$()
- *internally uses _.get(settings, 'keypath'))*
- *Be careful not to override _.$() default settings
```js
_.$('rjs.options.paths')       // get
_.$('rjs.options.paths', true) // set
```

#### *Default Settings*
```json
{
  "paths": {
    "code": "F:",
    "dev": "Y:",
    "prod": "Z:"
  },
  "rjs": {
    "optimize_options": ["none", "uglify"],
    "file_suffix_map": { "none": "", "uglify": "min" },
    "result_key_order": ['name', 'src', 'results', 'files', 'paths', 'shim'],
    "options": {
      "enabled": true,
      "baseUrl": "js",
      "name": "main",
      "out": "public/js/scripts.js",
      "optimize": "none",
      "paths": {
        "text": CDN_REQ_TEXT,
        "jquery": IGNORE,
        "underscore": IGNORE,
        "moment": IGNORE,
        "backbone": IGNORE,
        "ba": IGNORE,
        "jqueryactual": IGNORE,
        "jqappear": IGNORE,
        "jquerycookie": IGNORE,
        "jqueryui": IGNORE,
        "jquery.ui.widget": IGNORE,
        "jqueryiframetransport": IGNORE,
        "jqueryfileupload": IGNORE,
        "ace": IGNORE,
        "iscroll": IGNORE,
        "spin": IGNORE,
        "sio": IGNORE,
        "spectrum": IGNORE,
        "twemoji": IGNORE,
        "fblib": IGNORE
      },
      "shim": {
        "jquery": { "exports": "$" },
        "underscore": { "exports": "_" },
        "lodash": { "exports": "_" },
        "backbone": { "exports": "Backbone", "deps": ["underscore", "jquery"] },
        "ba": { "deps": ["underscore", "backbone"] },
        "jqueryui": { "deps": ["jquery"] },
        "jquerycookie": { "deps": ["jquery"] },
        "jqueryactual": { "deps": ["jquery"] },
        "jqappear": { "deps": ["jquery"] },
        "jqhashchange": { "deps": ["jquery"] },
        "jqeasytabs": { "deps": ["jquery", "jqhashchange"] },
        "jqueryiframetransport": { "deps": ["jquery"] },
        "jqueryfileupload": { "deps": ["jquery", "jqueryiframetransport"] },
        "ace": { "exports": "ace" },
        "spectrum": { "deps": ["jquery"] },
        "twemoji": { "exports": "twemoji" }
      }
    },
    "client_paths": {
      "text": CDN_URL + "/js/require/text.min",
      "jquery": CDN_URL + "/js/jquery/jquery.slim.min",
      "underscore": CDN_URL + "/js/lodash/lodash.slim.min",
      "moment": CDN_URL + "/js/moment/moment.min",
      "backbone": CDN_URL + "/js/backbone/backbone.min",
      "ba": CDN_URL + "/js/backbone/ba.min",

      "jqueryactual": CDN_URL + "/jquery.actual.min",
      "jqappear": CDN_URL + "/jquery.appear.min",
      "jquerycookie": CDN_URL + "/jquery.cookie.min",
      "jqueryui": CDN_URL + "/jquery.ui.min",
      "jquery.ui.widget": CDN_URL + "/jquery.ui.widget.min",
      "jqueryiframetransport": CDN_URL + "/jquery.iframe-transport.min",
      "jqueryfileupload": CDN_URL + "/jquery.fileupload.min",

      "ace": CDN_URL + "/ace",
      "iscroll": CDN_URL + "/iscroll.min",
      "spin": CDN_URL + "/spin.min",
      "sio": CDN_URL + "/sio.min",
      "spectrum": CDN_URL + "/spectrum.min",
      "twemoji": CDN_URL + "/twemoji.min",
      "fblib": "//connect.facebook.net/en_US/all",

      "mans": CDN_URL + "/snapp/mans",
      "models": CDN_URL + "/snapp/models",
      "node": CDN_URL + "/snapp/node",
      "plat": CDN_URL + "/snapp/plat",
      "rest": CDN_URL + "/snapp/rest",
      "ui": CDN_URL + "/snapp/ui",
      "mixins": CDN_URL + "/snapp/mixins"
    }
  }
}
```

---

## Compiling/Optimizing .js
```js
rjs.render(options, callback)
```

---

## UI Generation

Creates UI Kits on the fly

---

&nbsp;

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