Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# svelte-json-tree
# @sveltejs/svelte-json-tree

![version](https://img.shields.io/npm/v/svelte-json-tree?style=flat-square) ![MIT License](https://img.shields.io/npm/l/svelte-json-tree?style=flat-square)
![version](https://img.shields.io/npm/v/@sveltejs/svelte-json-tree?style=flat-square) ![MIT License](https://img.shields.io/npm/l/@sveltejs/svelte-json-tree?style=flat-square)

![svelte-json-tree](./images/screenshot.png)

Expand All @@ -14,10 +14,10 @@ Use [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/lang/en) to inst

```sh
# npm
npm install --save svelte-json-tree
npm install --save @sveltejs/svelte-json-tree

# yarn
yarn add svelte-json-tree
yarn add @sveltejs/svelte-json-tree
```

## Usage
Expand All @@ -26,7 +26,7 @@ With Svelte:

```html
<script>
import JSONTree from 'svelte-json-tree';
import JSONTree from '@sveltejs/svelte-json-tree';
// your json data to view
const value = {
array: [1, 2, 3],
Expand All @@ -43,7 +43,7 @@ With Svelte:
Without Svelte:

```js
const JSONTree = require('svelte-json-tree');
const JSONTree = require('@sveltejs/svelte-json-tree');
const jsonTree = new JSONTree({
target: document.body,
props: {
Expand All @@ -57,7 +57,7 @@ jsonTree.$set({ value: ['1'] });

## Overriding Styles

**svelte-json-tree** uses the following CSS variables to theme:
**@sveltejs/svelte-json-tree** uses the following CSS variables to theme:

```css
/* color */
Expand Down Expand Up @@ -93,4 +93,4 @@ To overwrite the style, specify the css variables on the parent:

## License

[MIT](https://github.com/tanhauhau/svelte-json-tree/blob/master/LICENSE)
[MIT](https://github.com/sveltejs/svelte-json-tree/blob/master/LICENSE)
8 changes: 4 additions & 4 deletions src/routes/(docs)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<h1>svelte-json-tree</h1>

<div>
<a target="_blank" href="https://npmjs.com/svelte-json-tree">
<img alt="npm-version" src="https://img.shields.io/npm/v/svelte-json-tree.svg" />
<a target="_blank" href="https://npmjs.com/sveltejs/svelte-json-tree">
<img alt="npm-version" src="https://img.shields.io/npm/v/sveltejs/svelte-json-tree.svg" />
</a>
&nbsp;
<a target="_blank" href="https://github.com/tanhauhau/svelte-json-tree">
<img alt="github" src="https://img.shields.io/github/stars/tanhauhau/svelte-json-tree?style=social" />
<a target="_blank" href="https://github.com/sveltejs/svelte-json-tree">
<img alt="github" src="https://img.shields.io/github/stars/sveltejs/svelte-json-tree?style=social" />
</a>
</div>

Expand Down
12 changes: 6 additions & 6 deletions src/routes/(docs)/docs/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
With `npm`

```sh
npm install svelte-json-tree
npm install @sveltejs/svelte-json-tree
```

With `yarn`

```sh
yarn add svelte-json-tree
yarn add @sveltejs/svelte-json-tree
```

## Use it

```svelte
<script>
import JsonTree from 'svelte-json-tree';
import JsonTree from '@sveltejs/svelte-json-tree';
let value = {
message: 'hello world',
item: [1, 2, 3],
Expand Down Expand Up @@ -214,10 +214,10 @@ You can set `shouldShowPreview` to `false` to hide it.

## ESM / Standalone / UMD

You can import `svelte-json-tree` directly, without having to setting up plugins to transform `.svelte` code
You can import `@sveltejs/svelte-json-tree` directly, without having to setting up plugins to transform `.svelte` code

```js
import Jsontree from 'svelte-json-tree';
import Jsontree from '@sveltejs/svelte-json-tree';

new Jsontree({
target: document.body,
Expand All @@ -228,7 +228,7 @@ new Jsontree({
If you want to use it without installing `svelte`, use the **standalone** version

```js
import Jsontree from 'svelte-json-tree/standalone';
import Jsontree from '@sveltejs/svelte-json-tree/standalone';

new Jsontree({
target: document.body,
Expand Down