# requirejs-config-file

> A small api to read and write your requirejs config file

Latest version **4.0.0** (published 2020-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install requirejs-config-file
pnpm add requirejs-config-file
yarn add requirejs-config-file
bun add requirejs-config-file
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2020-11-28 |
| First published | 2013-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 2 |
| Unpacked size | 39.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Philipp Scheit |
| Maintainers | pscheit |
| Keywords | requirejs, config |

## Links

- npm: https://www.npmjs.com/package/requirejs-config-file
- Repository: https://github.com/webforge-labs/requirejs-config-file
- Homepage: https://github.com/webforge-labs/requirejs-config-file#readme
- Issues: https://github.com/webforge-labs/requirejs-config-file/issues
- npm.io page: https://npm.io/package/requirejs-config-file

## Dependencies (2)

- [esprima](https://npm.io/package/esprima.md) ^4.0.0
- [stringify-object](https://npm.io/package/stringify-object.md) ^3.2.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2020-11-28
- 3.1.2 — 2019-03-24
- 3.1.1 — 2018-12-10
- 3.0.0 — 2018-01-07
- 2.0.1 — 2016-11-13
- 2.0.0 — 2014-07-22
- 1.2.2 — 2014-07-22
- 1.2.1 — 2013-09-26
- 1.2.0 — 2013-09-26
- 1.1.1 — 2013-09-25
- 1.1.0 — 2013-09-25
- 1.0.5 — 2013-09-20
- 1.0.4 — 2013-09-19
- 1.0.3 — 2013-09-18
- 1.0.2 — 2013-09-18
- … 1 more at https://npm.io/package/requirejs-config-file/versions

## README

# requirejs-config-file [![Build Status](https://travis-ci.org/webforge-labs/requirejs-config-file.svg?branch=master)](https://travis-ci.org/webforge-labs/requirejs-config-file)

[![NPM](https://nodei.co/npm/requirejs-config-file.png?downloads=true)](https://www.npmjs.org/package/requirejs-config-file)

A small api to read and write your requirejs config file


## installation

```
npm install requirejs-config-file
```

## usage

### require the constructor
```js
var ConfigFile = require('requirejs-config-file').ConfigFile;
```

### read
```js
// Read: reading the config
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));

var config = configFile.read();

console.log(config); // is an object with the found config
```

### modify (read and write)
```js
// Modify: reading and writing the config
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));

var config = configFile.read();

config.baseUrl = '/new';

configFile.write();
```

### create
```js
// CreateExample: creating a new config file
var configFile = new ConfigFile('path/to/new-config.js'));

configFile.createIfNotExists();

configFile.write();
```

### create or modify
```js
// CreateAndModifyExample: reading and writing a maybe not existing config file
var configFile = new ConfigFile('path/to/new-config.js'));

configFile.createIfNotExists();

configFile.read();

config.baseUrl = '/new';

configFile.write();
```

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