open-index/open-npm huggingface dataset:
npm package: @nativescript/appwrite
Description: Appwrite SDK for NativeScript
Author: NativeScript
Latest version: 0.1.1

# @nativescript/appwrite

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Appwrite SDK for NativeScript to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.

```bash
npm install @nativescript/appwrite
```

## Usage

Register an Appwrite account [here](https://appwrite.io/) and create a project to gather your endpoint and project id.

Setup a `.env` file at the root of your project with the following:

```base
APP_WRITE_ENDPOINT=https://[YOUR_APPWRITE_ENDPOINT]
APP_WRITE_PROJECT_ID=[YOUR_APPWRITE_PROJECT_ID]
```

Within you `webpack.config.js` you can also `npm install dotenv --save-dev` and configure it to load them:

```js
require('dotenv').config();

module.exports = (env) => {
    // rest of config
}
```

### Connect Client

```ts
import { Client, Account, ID } from '@nativescript/appwrite';

const client = new Client()
    .setEndpoint(process.env.APP_WRITE_ENDPOINT)
    .setProject(process.env.APP_WRITE_PROJECT_ID)
    .setSelfSigned(true); // for development
const account = new Account(client);
```

### Create Account

```ts
const response = await account.create(ID.unique(), 'me@company.com', 'password');
console.log('Account created:', response);
```

### Login

```ts
const response = await account.createEmailPasswordSession('me@company.com', 'password');console.log('Logged in:', response);
```

### List Documents

```ts
const database = new Databases(client);
const documents = await database.listDocuments('database-id', 'collection-id');
console.log('documents:', documents);
```

### Create Documents

```ts
const result = await database.createDocument(
    'database-id', 
    'collection-id',
    crypto.randomUUID(),
    { message: 'Hello World' }
);
console.log('Document created:', result);
```


## License

Apache License Version 2.0
npm package: @nativescript/auto-fit-text
Description: NativeScript plugin for a label that resizes on a single line to fit the screen.
Author: NativeScript
Latest version: 1.0.3

# @nativescript/auto-fit-text

```cli
ns plugin add @nativescript/auto-fit-text
```

This plugin is based on the Nativescript Label implementation but with changes to adjust the font size according of the label's width

## Usage

### Nativescript

```xml
<Page
  xmlns="http://schemas.nativescript.org/tns.xsd"
  loaded="pageLoaded"
  class="page"
  xmlns:AFT="@nativescript/auto-fit-text"
>
  <StackLayout class="p-20">
    <AFT:AutoFitText
      text="Testinggggggggggggggggg"
      textWrap="false"
    ></AFT:AutoFitText>
  </StackLayout>
</Page>
```

### Angular NativeScript

```typescript
import { NativeScriptAutoFitTextModule } from '@nativescript/auto-fit-text/angular';

// Be sure to add the plugin module to your NgModule
@NgModule({
	imports: [NativeScriptAutoFitTextModule],
})
```

```xml
<AutoFitText row="2" fontSize="48" text="Lorem Ipsum this line of text with fontSize ignored because the text is so long." textWrap="false"></AutoFitText>
```

## Credits

[@grantland - android-autofittextview](https://github.com/grantland/android-autofittextview)

## License

Apache License Version 2.0, January 2004
npm package: @nativescript/brightness
Description: NativeScript plugin, that helps you set the brightness of the screen for Android and iOS.
Author: NativeScript
Latest version: 2.0.0

# Nativescript brightness

```javascript
ns plugin add @nativescript/brightness
```

This command automatically installs the necessary files, as well as stores @nativescript/brightness as a dependency in your project's `package.json` file.

This plugin requires `<uses-permission android:name="android.permission.WRITE_SETTINGS"/>` to be added in the android manifest.

## Usage

To use the brightness module you must first `require()` and instantiate it:

```js
// JavaScript
var nativescriptBrightness = require("@nativescript/brightness");
var brightness = new nativescriptBrightness.Brightness();
```

Or if you’re using TypeScript, `import` the module:

```typescript
// TypeScript
import { Brightness } from '@nativescript/brightness';
const brightness = new Brightness();
```

After you have a reference to the module you can then call its `get()` and `set()` methods. For example, the code below updates you screen's brightness with an `intensity` setting of 25%.

The `intensity` can be set to a value from 1 to 100.

```js
// TypeScript
import { Brightness } from '@nativescript/brightness';
const brightness = new Brightness();

brightness.set({
    intensity: 25
});
```

## API

### Methods
    
| Method | Description |
| --- | --- |
| set(options: BrightnessOptions) |  set screen's brightness to the desired intensity |
| get | returns current screen brightness value as a number between 0 and 100 |
| getNative | returns current screen brightness value as returned from the native api: between 0.0 and 1.0 for iOS and 0 and 255 for android  |

### BrightnessOptions

| Property | Default | Description |
| --- | --- | --- |
| intensity | 100 | defines the desired brightness value, which should be a number between 0 and 100. |

## License

Apache License Version 2.0