# is-cson

> Determines whether a string is valid CSON

Latest version **4.0.0** (published 2023-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-cson
pnpm add is-cson
yarn add is-cson
bun add is-cson
```

## 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 | 4.0.0 |
| Published | 2023-12-26 |
| First published | 2019-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | idleberg |
| Keywords | cson, coffeescript |

## Links

- npm: https://www.npmjs.com/package/is-cson
- Repository: https://github.com/idleberg/node-is-cson
- Homepage: https://github.com/idleberg/node-is-cson#readme
- Issues: https://github.com/idleberg/node-is-cson/issues
- npm.io page: https://npm.io/package/is-cson

## Dependencies (1)

- [cson-parser](https://npm.io/package/cson-parser.md) ^4.0.5

## Recent versions

- 4.0.0 (latest) — 2023-12-26
- 3.0.3 — 2023-07-23
- 3.0.2 — 2023-07-23
- 3.0.1 — 2022-12-22
- 3.0.0 — 2022-01-04
- 2.0.0 — 2021-07-26
- 1.2.1 — 2020-09-05
- 1.2.0 — 2020-09-05
- 1.1.1 — 2020-09-03
- 1.1.0 — 2020-07-04
- 1.0.1 — 2020-07-04
- 1.0.0 — 2019-12-28
- 0.1.1 — 2019-07-23
- 0.1.0 — 2019-05-25

## README

# is-cson

> Determines whether a string is valid CSON

[![License](https://img.shields.io/github/license/idleberg/node-is-cson?color=blue&style=for-the-badge)](https://github.com/idleberg/node-is-cson/blob/main/LICENSE)
[![Version](https://img.shields.io/npm/v/is-cson?style=for-the-badge)](https://www.npmjs.org/package/is-cson)
[![Build](https://img.shields.io/github/actions/workflow/status/idleberg/node-is-cson/default.yml?style=for-the-badge)](https://github.com/idleberg/node-is-cson/actions)

## Installation

`npm install is-cson -S`

## Usage

`isCSON(string, options?)`

**Example:**

```js
import { isCSON } from 'is-cson';

// Generate CSON string
const csonString = `
  firstName: 'John'
  lastName: 'Doe'
`;

isCSON(csonString);
// => true
```

### Options

#### `allowJSON`

Default: `false`  

Since CSON is a superset of *well-formatted* JSON, this library runs *strict* tests for CSON only. Enabling this option will also validate JSON, with CSON-specific features (such as trailing commas or single quotes) taking precedence.

<details>
<summary><strong>Example</strong></summary>

```js
const jsonString = `{
  "firstName": "John",
  "lastName": "Doe"
}`;

isCSON(jsonString, { allowJSON: true });
// => true
```
</details>

## License

This work is licensed under [The MIT License](https://opensource.org/licenses/MIT)

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