# remarks

> JSON comments handling

Latest version **0.3.4** (published 2015-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install remarks
pnpm add remarks
yarn add remarks
bun add remarks
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2015-10-18 |
| First published | 2015-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Carl Winkler |
| Maintainers | seikho |
| Keywords | json, comments |

## Links

- npm: https://www.npmjs.com/package/remarks
- Repository: https://github.com/seikho/remarks
- Homepage: https://github.com/seikho/remarks#readme
- Issues: https://github.com/seikho/remarks/issues
- npm.io page: https://npm.io/package/remarks

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.4 (latest) — 2015-10-18
- 0.3.3 — 2015-10-06
- 0.3.1 — 2015-10-06
- 0.3.0 — 2015-10-06
- 0.2.0 — 2015-10-06
- 0.1.1 — 2015-10-06
- 0.1.0 — 2015-10-06

## README

### Remarks
Simple two-way conversion and maintenance of JSON comments

### Installation
```
npm install --save remarks
```

### Sample usage

```javascript
/* Optionally takes a JSON string that should be an array */

var remarks;

// Example using knex
knex('post').select().where('id', id)
    .then(post => new Remarks(post.comments))
    .then(r => remarks = r);

// meanwhile, some time later...

remarks.add({ name: 'seikho', comment: 'i love remarks' });

knex('post')
    .update({ comments: remarks.toString() })
    .where('id', 'id');
    .then(() => console.log('updated'));
```

### API
#### constructor
```javascript
constructor(json?: string)
```

#### add
Add a comment to the list of comments
```javascript
function add(comment: T): void;
```

#### parse
Re-populate the array with entirely new comments
```javascript
function parse(json: string): void;
```

#### toArray
Return a copy of the comments array
```javascript
function toArray(): Array<T>;
```

#### toString
Return the comments as a JSON string
```javascript
function toString(): string;
```

### License
MIT

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