4.0.0 • Published 4 months ago

is-cson v4.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 months ago

is-cson

Determines whether a string is valid CSON

License Version Build

Installation

npm install is-cson -S

Usage

isCSON(string, options?)

Example:

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.

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

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

License

This work is licensed under The MIT License

4.0.0

4 months ago

3.0.3

9 months ago

3.0.2

9 months ago

3.0.1

1 year ago

3.0.0

2 years ago

2.0.0

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago