# @types/node-crate

> TypeScript definitions for node-crate

Latest version **2.0.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/node-crate
pnpm add @types/node-crate
yarn add @types/node-crate
bun add @types/node-crate
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2023-11-07 |
| First published | 2018-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/node-crate
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-crate
- npm.io page: https://npm.io/package/@types/node-crate

## Recent versions

- 2.0.5 (latest) — 2023-11-07
- 2.0.2 (ts2.2) — 2019-02-13
- 2.0.4 — 2023-10-18
- 2.0.3 — 2023-09-23
- 2.0.1 — 2018-10-15
- 2.0.0 — 2018-10-03

## README

# Installation
> `npm install --save @types/node-crate`

# Summary
This package contains type definitions for node-crate (https://github.com/megastef/node-crate).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-crate.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-crate/index.d.ts)
````ts
declare namespace crate {
    interface DBResultObject {
        json: object[];
        duration: number;
        rowcount: number;
        cols: string[];
        rows: object[][];
    }

    interface Crate {
        /**
         * Connect to a single crate instance with host and port
         */
        connect: (host: string, port?: number) => void;
        /**
         * Executes a parameterized sql statement.
         */
        execute: (sql: string, args?: Array<string | number | Date>) => Promise<DBResultObject>;
        /**
         * Inserts a row in table.
         */
        insert: (tableName: string, data: object) => Promise<DBResultObject>;
        /**
         * Creates a table with the given schema.
         */
        create: (schema: object) => Promise<DBResultObject>;
        /**
         * Creates a table if it doesn't already exist.
         */
        createIfNotExists: (schema: object) => Promise<DBResultObject>;
        /**
         * Drops a table.
         */
        drop: (tableName: string) => Promise<DBResultObject>;
        /**
         * Updates one or more rows in table.
         */
        update: (tableName: string, data: object, where: string) => Promise<DBResultObject>;
        /**
         * Deletes one or more rows in a table.
         */
        delete: (tableName: string, where: string) => Promise<DBResultObject>;
        /**
         * Creates a BLOB table
         */
        createBlobTable: (tableName: string, replicas: number, shards: number) => Promise<DBResultObject>;
        /**
         * Inserts a BLOB
         */
        insertBlob: (tableName: string, buffer: string) => Promise<string>;
        /**
         * Inserts a BLOB from the filesystem
         */
        insertBlobFile: (tableName: string, filename: string) => Promise<string>;
        /**
         * Retrieves a BLOB with the given hash key
         */
        getBlob: (tableName: string, hashKey: string) => Promise<string>;
    }
}

declare var crate: crate.Crate;
export = crate;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Greg Jednaszewski](https://github.com/gjednaszewski).

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