# handlebars-partial-file

> Helper utility for including files as Handlebars template partials

Latest version **1.0.0** (published 2018-01-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install handlebars-partial-file
pnpm add handlebars-partial-file
yarn add handlebars-partial-file
bun add handlebars-partial-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 | 1.0.0 |
| Published | 2018-01-12 |
| First published | 2018-01-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ikenna Agbasimalo |
| Maintainers | ikmich |
| Keywords | Handlebars, partials |

## Links

- npm: https://www.npmjs.com/package/handlebars-partial-file
- Repository: https://github.com/ikmich/handlebars-partial-file
- Homepage: https://github.com/ikmich/handlebars-partial-file#readme
- Issues: https://github.com/ikmich/handlebars-partial-file/issues
- npm.io page: https://npm.io/package/handlebars-partial-file

## Dependencies (1)

- [handlebars](https://npm.io/package/handlebars.md) ^4.0.11

## Recent versions

- 1.0.0 (latest) — 2018-01-12

## README

### Description
Helper utility for including files as Handlebars template partials. __handlebars-partial-file__ reads a file's contents and registers it as a partial for use within a Handlebars template.

### Installation  
`npm install handlebars-partial-file`

### Usage
###### Require the package and initialize options:
```javascript
const hbsPartialFile = require('handlebars-partial-file')(options);
```
__options__
```javascript
{
    referenceDir: '.' // Directory path from which to reference the registered partials
}
```

###### Register a file as a Handlebars partial
```javascript
hbsPartialFile.registerFile(filepath, [nameOfPartial]);
```
__args__  
`filepath` - The file path to include as partial.  
`nameOfPartial` - (Optional) Name to register the partial as. If omitted, the file name will be used.

###### Register a directory whose files are to be registered as Handlebars partials
```javascript
hbsPartialFile.registerDirectory(dirPath, ext);
```
__args__  
`dirPath` - Directory path whose files to include.  
`ext` - (Optional) Permitted file extension, or `*`. If omitted, all files would be included.

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