# xtal-editor

> Edit JSON

Latest version **0.0.199** (published 2022-10-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.199 |
| Published | 2022-10-19 |
| First published | 2020-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 25 |
| Unpacked size | 99.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | anderson.bruce.b@gmail.com |
| Maintainers | bahrus |
| Keywords | web-components, web-component, custom-element, custom-elements, JSON, Editor |

## Links

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

## Dependencies (25)

- [be-hive](https://npm.io/package/be-hive.md) 0.0.76
- [be-lazy](https://npm.io/package/be-lazy.md) 0.0.25
- [be-active](https://npm.io/package/be-active.md) 0.0.44
- [be-loaded](https://npm.io/package/be-loaded.md) 0.0.90
- [be-oosoom](https://npm.io/package/be-oosoom.md) 0.0.9
- [may-it-be](https://npm.io/package/may-it-be.md) 0.0.170
- [xtal-tree](https://npm.io/package/xtal-tree.md) 0.0.169
- [be-adopted](https://npm.io/package/be-adopted.md) 0.0.10
- [be-noticed](https://npm.io/package/be-noticed.md) 0.0.72
- [xtal-vlist](https://npm.io/package/xtal-vlist.md) 0.0.89
- [be-composed](https://npm.io/package/be-composed.md) 0.0.8
- [be-repeated](https://npm.io/package/be-repeated.md) 0.0.97
- [be-switched](https://npm.io/package/be-switched.md) 0.0.84
- [be-decorated](https://npm.io/package/be-decorated.md) 0.0.182
- [be-deslotted](https://npm.io/package/be-deslotted.md) 0.0.41
- [be-importing](https://npm.io/package/be-importing.md) 0.0.39
- [be-observant](https://npm.io/package/be-observant.md) 0.0.155
- [trans-render](https://npm.io/package/trans-render.md) 0.0.628
- [xtal-element](https://npm.io/package/xtal-element.md) 0.0.531
- [be-channeling](https://npm.io/package/be-channeling.md) 0.0.30
- [be-definitive](https://npm.io/package/be-definitive.md) 0.0.69
- [xtal-side-nav](https://npm.io/package/xtal-side-nav.md) 0.0.97
- [be-open-and-shut](https://npm.io/package/be-open-and-shut.md) 0.0.5
- [be-transformative](https://npm.io/package/be-transformative.md) 0.0.51
- [@power-elements/json-viewer](https://npm.io/package/@power-elements/json-viewer.md) 2.1.1

## 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.0.199 (latest) — 2022-10-19
- 0.0.198 — 2022-10-19
- 0.0.197 — 2022-10-16
- 0.0.196 — 2022-09-09
- 0.0.195 — 2022-09-07
- 0.0.194 — 2022-09-07
- 0.0.193 — 2022-09-01
- 0.0.192 — 2022-08-29
- 0.0.191 — 2022-08-28
- 0.0.190 — 2022-08-28
- 0.0.189 — 2022-08-28
- 0.0.188 — 2022-08-28
- 0.0.187 — 2022-08-27
- 0.0.186 — 2022-08-26
- 0.0.185 — 2022-08-24
- … 183 more at https://npm.io/package/xtal-editor/versions

## README

# xtal-editor

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/bahrus/xtal-editor)

<a href="https://nodei.co/npm/xtal-editor/"><img src="https://nodei.co/npm/xtal-editor.png"></a>


[![Playwright Tests](https://github.com/bahrus/xtal-editor/actions/workflows/CI.yml/badge.svg?branch=baseline)](https://github.com/bahrus/xtal-editor/actions/workflows/CI.yml)

Re-creation of [flexi-json](http://www.daviddurman.com/flexi-json-editor/jsoneditor.html), taking some liberties, but as a web component.


## [Demo](https://json-editor-pwa.bahrus.workers.dev/)

xtal-editor is able to scale somewhat better for large JSON objects as compared to other alternative editors.

At least if a height is specified (if not, not very scalable).

## [API](https://cf-sw.bahrus.workers.dev/?href=https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fxtal-editor%400.0.159%2Fcustom-elements.json&stylesheet=https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fwc-info%2Fsimple-ce-style.css&embedded=false&tags=&ts=0.0.159&tocXSLT=https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fwc-info%2Ftoc.xsl)

## Usage

Locally:

```html
<xtal-editor style=height:350px;>
    <textarea>
        {
            "string":"foo",
            "number":5,
            "array":[1,2,3],
            "object":{
                "property":"value",
                "subobj":{
                    "arr":["foo","ha"],
                    "numero":1
                }
            }
        }
    </textarea>
</xtal-editor>
<script type=module>
    import 'xtal-editor/src/xtal-editor.js';
</script>
```

## [Reference API](https://bahrus.github.io/wc-info/cdn-base.html?npmPackage=xtal-editor@0.0.46)

## Referencing via CDN

```html
<script type=module crossorigin>
    import 'https://esm.run/xtal-editor@0.0.154';
</script>
```


## Running demos locally

To run locally (instructions may vary depending on OS):

1.  Install [node.js](https://nodejs.org/)
2.  Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
3.  Choose a directory where you would like the files to be placed, and open a command prompt from that location.
4.  Issue command "git clone https://github.com/bahrus/xtal-editor" in the command window.
5.  CD into the git clone directory.
6.  Issue command "npm install"
7.  When step 6 is completed, issue command "npm run start".

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