Skip to content

Commit

Permalink
Rename surrealdb.js to surrealdb (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
kearfy authored Jul 23, 2024
1 parent e9d8f78 commit 49c5ee5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ body:
- type: input
id: library-version
attributes:
label: SurrealDB.js version
description: Enter your project's directory, then copy and paste the output of `npm view surrealdb.js version`
label: JavaScript SDK version
description: Enter your project's directory, then copy and paste the output of `npm view surrealdb version`
placeholder: '0.0.0'
validations:
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest an idea for SurrealDB.js!
Thanks for taking the time to suggest an idea for the SurrealDB JavaScript SDK!
- type: textarea
id: problem
attributes:
Expand Down Expand Up @@ -44,8 +44,8 @@ body:
- type: input
id: library-version
attributes:
label: SurrealDB.js version
description: Enter your project's directory, then copy and paste the output of `npm view surrealdb.js version`
label: JavaScript SDK version
description: Enter your project's directory, then copy and paste the output of `npm view surrealdb version`
placeholder: '0.0.0'
validations:
required: true
Expand Down
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
 
<a href="https://surrealdb.com/docs/integration/libraries/javascript"><img src="https://img.shields.io/badge/docs-view-44cc11.svg?style=flat-square"></a>
&nbsp;
<a href="https://www.npmjs.com/package/surrealdb.js"><img src="https://img.shields.io/npm/v/surrealdb.js?style=flat-square"></a>
<a href="https://www.npmjs.com/package/surrealdb"><img src="https://img.shields.io/npm/v/surrealdb?style=flat-square"></a>
&nbsp;
<a href="https://www.npmjs.com/package/surrealdb.js"><img src="https://img.shields.io/npm/dm/surrealdb.js?style=flat-square"></a>
<a href="https://www.npmjs.com/package/surrealdb"><img src="https://img.shields.io/npm/dm/surrealdb?style=flat-square"></a>
&nbsp;
<a href="https://deno.land/x/surrealdb"><img src="https://img.shields.io/npm/v/surrealdb.js?style=flat-square&label=deno"></a>
<a href="https://deno.land/x/surrealdb"><img src="https://img.shields.io/npm/v/surrealdb?style=flat-square&label=deno"></a>
</p>

<p align="center">
Expand All @@ -32,7 +32,7 @@
<a href="https://www.youtube.com/channel/UCjf2teVEuYVvvVC-gFZNq6w"><img src="https://img.shields.io/badge/youtube-subscribe-fc1c1c.svg?style=flat-square"></a>
</p>

# surrealdb.js
# surrealdb

The official SurrealDB SDK for JavaScript.

Expand All @@ -50,31 +50,29 @@ Import it with:
import Surreal from "@surrealdb/surrealdb";
```

For best results, set a version in the url:

### Install for [Node.js](https://www.npmjs.com/package/surrealdb.js)
### Install for [Node.js](https://www.npmjs.com/package/surrealdb)

Install it with:

```sh
# using npm
npm i surrealdb.js
npm i surrealdb
# or using pnpm
pnpm i surrealdb.js
pnpm i surrealdb
# or using yarn
yarn add surrealdb.js
yarn add surrealdb
```

Next, just import it with:

```ts
const { Surreal } = require("surrealdb.js");
const { Surreal } = require("surrealdb");
```

or when you use modules:

```ts
import Surreal from "surrealdb.js";
import Surreal from "surrealdb";
```

### Install for the browser
Expand All @@ -83,33 +81,33 @@ For usage in a browser environment, when using a bundler (e.g. [Rollup](https://

```sh
# using npm
npm i surrealdb.js
npm i surrealdb
# or using pnpm
pnpm i surrealdb.js
pnpm i surrealdb
# or using yarn
yarn add surrealdb.js
yarn add surrealdb
```

Next, just import it with:

```ts
import Surreal from "surrealdb.js";
import Surreal from "surrealdb";
```

or when you use CommonJS:

```ts
const { Surreal } = require("surrealdb.js");
const { Surreal } = require("surrealdb");
```

### Install for the browser with a CDN

For fast prototyping we provide a browser-ready bundle. You can import it with:

```ts
import Surreal from "https://unpkg.com/surrealdb.js";
import Surreal from "https://unpkg.com/surrealdb";
// or
import Surreal from "https://cdn.jsdelivr.net/npm/surrealdb.js";
import Surreal from "https://cdn.jsdelivr.net/npm/surrealdb";
```

_**NOTE: this bundle is not optimized for production! So don't use it in production!**_
Expand All @@ -123,7 +121,7 @@ In the example below you can see how to connect to a remote instance of SurrealD
> This example makes use of [top level await](https://v8.dev/features/top-level-await), available in [modern browsers](https://caniuse.com/mdn-javascript_operators_await_top_level), [Deno](https://deno.com/) and [Node.js](https://nodejs.org/) >= 14.8.
```ts
import { Surreal, RecordId, Table } from "surrealdb.js";
import { Surreal, RecordId, Table } from "surrealdb";

const db = new Surreal();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "surrealdb.js",
"name": "surrealdb",
"version": "1.0.0-beta.18",
"type": "module",
"license": "Apache-2.0",
Expand Down

0 comments on commit 49c5ee5

Please sign in to comment.