# snippet-cutter

> Returns a subset of a string, composed by complete subsets found using delimeter between min and max length. If no complete subsets are found, returns a subset using length max and ellipsis.

Latest version **1.0.0** (published 2020-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install snippet-cutter
pnpm add snippet-cutter
yarn add snippet-cutter
bun add snippet-cutter
```

## 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 | 2020-06-23 |
| First published | 2016-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Isis T. Baulig |
| Maintainers | grindcode |
| Keywords | String, Subset, Snippet, Excerpt, Description, Substring, Slice, Parts, Delimeter, Read, More, Short, Shortener |

## Links

- npm: https://www.npmjs.com/package/snippet-cutter
- Repository: https://github.com/grindcode/snippet-cutter
- Homepage: https://github.com/grindcode/snippet-cutter#readme
- Issues: https://github.com/grindcode/snippet-cutter/issues
- npm.io page: https://npm.io/package/snippet-cutter

## Dependencies (1)

- [lodash.defaults](https://npm.io/package/lodash.defaults.md) ^4.2.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-06-23
- 0.1.4 — 2017-05-21
- 0.1.3 — 2016-01-26
- 0.1.2 — 2016-01-12
- 0.1.1 — 2016-01-11
- 0.1.0 — 2016-01-11

## README

# Snippet Cutter
[![Build Status](https://travis-ci.org/grindcode/snippet-cutter.svg)](https://travis-ci.org/grindcode/snippet-cutter) [![Dependency Status](https://david-dm.org/grindcode/snippet-cutter.svg)](https://david-dm.org/grindcode/snippet-cutter) [![devDependency Status](https://david-dm.org/grindcode/snippet-cutter/dev-status.svg)](https://david-dm.org/grindcode/snippet-cutter#info=devDependencies)

Returns a subset of a _string_, composed by complete subsets found using `delimeter` between `min` and `max` _length_. If no complete subsets are found, returns a subset using _length_ `max` and `ellipsis`.

## Get Started
```bash
npm install snippet-cutter
```

## API
### cutter(string, [options])
Returns `string` processed. The `options` parameter is optional, but must be an Object if specified, containing zero or more of the following properties:
* `delimiter`: String used to split subsets. (**String**; default: `'.'`)
* `min`: Min _string length_ for valid subset match. (**Number**; default: `1`)
* `max`: Max _string length_ for valid subset match. (**Number**; default: `140`)
* `ellipsis`: Ending string when no complete subset is found. (**String**; default: `'...'`)

### Usage
```javascript
var cutter = require('snippet-cutter')

cutter(string, options)
// → 'result subset of string'
```

## License
See the [License](LICENSE) file.

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