# @cappalyst/cappalyst

> all-in-one tools for your node.js app

Latest version **1.0.0** (published 2019-02-11) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @cappalyst/cappalyst
pnpm add @cappalyst/cappalyst
yarn add @cappalyst/cappalyst
bun add @cappalyst/cappalyst
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-11 |
| First published | 2019-01-30 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Unpacked size | 45 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Richard Kemp |
| Maintainers | sylv3r |
| Keywords | typescript, library, node, nodejs, node.js, app, i18n, api, service |

## Links

- npm: https://www.npmjs.com/package/@cappalyst/cappalyst
- Repository: https://github.com/cappalyst/cappalyst.js
- Issues: https://github.com/cappalyst/cappalyst/issues
- npm.io page: https://npm.io/package/@cappalyst/cappalyst

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-02-11
- 1.0.0-beta.6 (prerelease) — 2019-02-10
- 1.0.0-beta.5 — 2019-02-10
- 1.0.0-beta.4 — 2019-02-10
- 1.0.0-beta.1 — 2019-01-30
- 1.0.0-beta.0 — 2019-01-30

## README

# @cappalyst/cappalyst

[![NPM version][npm-image]][npm-url]
[![Greenkeeper][greenkeeper-image]][greenkeeper-url]
[![Dependency Status][dependencies-image]][dependencies-url]
[![Dev Dependency Status][devdependencies-image]][devdependencies-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![Build status][travis-image]][travis-url]
[![codecov][codecov-image]][codecov-url]
[![License][license-image]][license-url]

## Install

```
npm i @cappalyst/cappalyst
```

## Methods

### Global Augmentation

#### String

##### capitalize()

Capitalize the first letter of a string.

```js
const str = 'hello world!'
console.log(str.capitalize()) // Hello world!
```

##### sanitize()

Sanitize a `string` depending on the `type` of sanitization expected.

- regexp

```js
const str = '/hello+[world].'
console.log(str.sanitize('regexp')) // \/hello\+\[world\]\.
```

- html

```js
const str = 'unsafe <string>'
console.log(str.sanitize('html')) // unsafe%20%3Cstring%3E
```

### i18n

#### translator()

Translate a string based on a memoized dictionary.

```js
const translations = {
  hello: {
    en: 'hello world !',
    fr: 'bonjour tout le monde !',
  },
  helloName: {
    en: name => `hello ${name} !`,
    fr: name => `bonjour ${name} !`,
  },
}

const t = translator(translations)

console.log(t('hello', 'en')) // hello world !
console.log(t('helloName', 'fr')('john')) // bonjour john !
```

## License

[GPL-3.0](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@cappalyst/cappalyst.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@cappalyst/cappalyst
[greenkeeper-image]: https://badges.greenkeeper.io/cappalyst/cappalyst.js.svg?style=flat-square
[greenkeeper-url]: https://greenkeeper.io/
[dependencies-image]: https://david-dm.org/cappalyst/cappalyst.js/status.svg?style=flat-square
[dependencies-url]: https://david-dm.org/cappalyst/cappalyst.js
[devdependencies-image]: https://david-dm.org/cappalyst/cappalyst.js/dev-status.svg?style=flat-square
[devdependencies-url]: https://david-dm.org/cappalyst/cappalyst.js?type=dev
[snyk-image]: https://snyk.io/test/github/cappalyst/cappalyst.js/badge.svg?style=flat-square
[snyk-url]: https://app.snyk.io/test/github/cappalyst/cappalyst.js?targetFile=package.json
[travis-image]: https://img.shields.io/travis/cappalyst/cappalyst.js.svg?style=flat-square
[travis-url]: https://travis-ci.org/cappalyst/cappalyst.js
[codecov-image]: https://img.shields.io/codecov/c/github/cappalyst/cappalyst.js/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/cappalyst/cappalyst.js
[license-image]: https://img.shields.io/npm/l/@cappalyst/cappalyst.svg?style=flat-square
[license-url]: LICENSE

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