# literal-require

> A literal templating for Node require

Latest version **1.0.5** (published 2019-01-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install literal-require
pnpm add literal-require
yarn add literal-require
bun add literal-require
```

## 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 | 1.0.5 |
| Published | 2019-01-10 |
| First published | 2018-12-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Przemyslaw Walczak |
| Maintainers | przemyslawwalczak |

## Links

- npm: https://www.npmjs.com/package/literal-require
- Repository: https://github.com/przemyslawwalczak/literal-require
- Homepage: https://github.com/przemyslawwalczak/literal-require#readme
- Issues: https://github.com/przemyslawwalczak/literal-require/issues
- npm.io page: https://npm.io/package/literal-require

## Dependencies (1)

- [escape-regex-string](https://npm.io/package/escape-regex-string.md) ^1.0.6

## Recent versions

- 1.0.5 (latest) — 2019-01-10
- 1.0.4 — 2018-12-11
- 1.0.3 — 2018-12-11
- 1.0.2 — 2018-12-04
- 1.0.1 — 2018-12-04
- 1.0.0 — 2018-12-04

## README

### Nodejs literal templating for node native require module.

### Usage

```
npm i literal-require --save
```

```js
require('literal-require')
```


### Add namespace to your application `package.json`

```json
{
  ...

  -> "namespace": {
    "@application": "${ process.cwd() }/application"
  }
}
```


### Then use in your require's as follows

`require('@application/config.json')`

`require('@application/example-module')`


### require('path').literal('@application')

#### Will resolve the path with pre-evaluated literal key/value.

### require('literal-require).add(namespace, path)

#### Adds namespace to be used later with require or path.literal

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