# writedown-editor

> The main editor for writedown [https://github.com/iamparnab/writedown](https://github.com/iamparnab/writedown)

Latest version **1.1.3** (published 2019-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install writedown-editor
pnpm add writedown-editor
yarn add writedown-editor
bun add writedown-editor
```

## 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.1.3 |
| Published | 2019-12-26 |
| First published | 2019-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 46.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | itssayantan |
| Keywords | writedown-editor, writedown, editor, text, code |

## Links

- npm: https://www.npmjs.com/package/writedown-editor
- Repository: https://github.com/itssayantan/writedown-editor
- Homepage: https://github.com/itssayantan/writedown-editor#readme
- Issues: https://github.com/itssayantan/writedown-editor/issues
- npm.io page: https://npm.io/package/writedown-editor

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^3.3.3
- [react](https://npm.io/package/react.md) ^16.11.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.11.0
- [custom-error-boundary](https://npm.io/package/custom-error-boundary.md) ^2.0.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2019-12-26
- 1.1.2 — 2019-12-26
- 1.1.1 — 2019-12-02
- 1.1.0 — 2019-12-01
- 1.0.11 — 2019-11-30
- 1.0.10 — 2019-11-30
- 1.0.9 — 2019-11-30
- 1.0.8 — 2019-11-30
- 1.0.7 — 2019-11-30
- 1.0.6 — 2019-11-30
- 1.0.5 — 2019-11-30
- 1.0.4 — 2019-11-30
- 1.0.3 — 2019-11-30
- 1.0.2 — 2019-11-30
- 1.0.1 — 2019-11-30
- … 1 more at https://npm.io/package/writedown-editor/versions

## README

# writedown-editor

The main editor for writedown [https://github.com/iamparnab/writedown](https://github.com/iamparnab/writedown)

# Installation

`$ npm install --save writedown-editor`
or
`yarn add writedown-editor`
if you are using yarn

# Usage

Here is a sample code which shows the use of **markdown-editor** inside a `React` component.

```js
import React from "react";
import ReactDOM from "react-dom";
import WriteDownEditor from "writedown-editor";

const options = {
  lineBackground: "black",
  lineForeground: "white",
  focussedLineBackground: "white",
  focussedLineForeground: "black",
  editorBackground: "blue",
  editorForeground: "white",
  cursorColor: "rgba(255,0,0,1)",
  onChange: (ev: any) => {
    console.log(ev.getPlainTextContent());
  }
};

function Main() {
  return <WriteDownEditor options={options} />;
}

ReactDOM.render(<Main />, document.querySelector("#root"));
```

# Props

The `WriteDownEditor` component takes an `options` prop.
The `options` prop is of type `WriteDownEditorProp`

```js
type WriteDownEditorProps = {
  options: {
    lineBackground: string;
    lineForeground: string;
    focussedLineBackground: string;
    focussedLineForeground: string;
    editorBackground: string;
    editorForeground: string;
    cursorColor: string;
    onChange: (ev: WriteDownOnChangeEventObject) => void;
  }
 }
```

The `onChange` event handler has `WriteDownOnChangeEventObject` type

```js
type WriteDownOnChangeEventObject = {
    currentLineContent: string;
    getPlainTextContent: () => string;
    numberOfLines: number;
    lineNumber: number;
    columnNumber: number;
}
```

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