open-index/open-npm huggingface dataset:
npm package: @sampathkumara/realtime-sync-server
Description: Real-time data synchronization server with LokiJS and Socket.IO. Self-hosted, offline-first sync for Node.js applications.
Author: Sampath Kumara
Latest version: 1.0.25

# Sync Server

High-performance, real-time data synchronization server built with LokiJS, Socket.IO, and Express. This server is designed for applications that require instant data updates and efficient client-server communication.

## Key Features

- **Real-time Sync**: Uses Socket.IO to push changes to clients instantly.
- **RESTful API**: Provides a complete REST API for standard HTTP interactions.
- **Efficient In-Memory Database**: Powered by LokiJS for extremely fast data access.
- **Delta Synchronization**: Only sends changes since the client's last sync time, saving bandwidth.
- **Bulk Operations**: Optimized endpoints for high-performance bulk inserts, updates, and deletes.
- **Change Consolidation**: In-memory consolidation of changes to reduce database I/O and ensure only the net change is logged.
- **Configurable**: Easily configure the server, logging, and database settings using a `.env` file.
- **Structured Logging**: Uses Winston for structured, leveled logging.
- **Compression**: Enables per-message deflate compression to reduce bandwidth.

## Getting Started

### 1. Installation

```bash
npm install
```

### 2. Configuration

Create a `.env` file in the root of the project. You can copy the `.env.example` file to get started:

```bash
cp .env.example .env
```

Modify the `.env` file to customize your settings:

```
# Server Configuration
PORT=3000
CORS_ORIGIN=*

# Database Configuration
DB_PATH=./data/sync.db
DB_AUTOSAVE=true
DB_AUTOSAVE_INTERVAL=5000

# Logging Configuration
LOG_LEVEL=info
LOG_ENABLED=true
LOG_FILE=./logs/sync-server.log
LOG_ERROR_FILE=./logs/sync-server-error.log

# Bulk Operation Configuration
DEFAULT_BATCH_SIZE=500
BATCH_DELAY_MS=5

# Compression Configuration
COMPRESSION_ENABLED=true

# Socket.IO Transports (comma-separated: websocket,polling)
TRANSPORTS=websocket,polling
```

### 3. Running the Server

```typescript
import { SyncServer } from './src/SyncServer';

// Default server
const server = new SyncServer();
server.start();

// Server with a separate .env file
const server2 = new SyncServer({
  envFilePath: './.env.server2',
});
server2.start();

// Server with custom parameters
const server3 = new SyncServer({
  port: 3003,
  dbPath: './data/server3.db',
  transports: ['polling'], // Force polling for this instance
});
server3.start();
```

## API Documentation

For a detailed API reference, see [API_DOCUMENTATION.md](API_DOCUMENTATION.md).

## Development

```bash
# Install dependencies
npm install

# Run development server with hot-reloading
npm run dev

# Build for production
npm run build

# Start production server
npm start
```

## License

MIT
npm package: @sampetering/provider-provider
Description: You could totally write this yourself, but why would you?
Author: Sam Petering
Latest version: 2.0.0

<h1 align="center">provider-provider</h1>
<p>
  <a href="https://www.npmjs.com/package/@sampetering/provider-provider" target="_blank">
    <img alt="Version" src="https://img.shields.io/npm/v/@sampetering/provider-provider.svg">
  </a>
  <a href="#" target="_blank">
    <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
  </a>
</p>

<ProviderProvider /> provides your providers.

## Install

```sh
pnpm add @sampetering/provider-provider
```

## Usage

```
// Provide your providers to ProviderProvider with the providers prop.
<ProviderProvider providers={[ProviderA, ProviderB, ProviderC, ...]}>
  <App />
</ProviderProvider>
```
npm package: @sampettersson/primitives
Description: > Style and render primitive interfaces across multiple targets with emotion
Latest version: 9.2.16

# @emotion/primitives

> Style and render primitive interfaces across multiple targets with emotion

## Introduction

Emotion primitives makes it easy to style and render primitives across multiple platforms like the web, React Native and Sketch using the `emotion` API.

## Install

```
npm install @emotion/primitives
```

or if you use yarn

```
yarn add @emotion/primitives
```

This package also depends on `react`, `react-primitives` and `prop-types` so make sure you've them installed.

## Example

```js
import React from 'react'
import styled, { css } from '@emotion/primitives'

import { ThemeProvider } from 'emotion-theming'

const theme = {
  color: 'hotpink',
  backgroundColor: 'purple'
}

const Container = styled.View`
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 50px;
  border: 5px solid red;
  background-color: ${props => props.theme.backgroundColor};
`

const Description = styled.Text({
  color: 'hotpink'
})

const Image = styled.Image`
  padding: 40px;
`

const emotionLogo =
  'https://cdn.rawgit.com/emotion-js/emotion/master/emotion.png'

class App extends React.Component {
  render() {
    return (
      <ThemeProvider theme={theme}>
        <Container
          style={css`
            border-radius: 10px;
          `}
        >
          <Description style={{ fontSize: 45, fontWeight: 'bold' }}>
            Emotion Primitives
          </Description>
          <Image
            source={{
              uri: emotionLogo,
              height: 150,
              width: 150
            }}
          />
        </Container>
      </ThemeProvider>
    )
  }
}
```

[![Edit n3nmq8v46j](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/n3nmq8v46j)

## Supported primitives

* **Text**

* **View**

* **Image**

## Usage with `react-sketchapp`

### Installing dependencies

* [`react-sketchapp`](https://github.com/airbnb/react-sketchapp)

```
yarn add react-sketchapp
```

* `skpm` for building and publishing sketch plugins. This is required to render the components and build them to Sketch environment.

```
yarn add @skpm/builder --dev
```

### Configuring `skpm` builder

Once you've installed `skpm`,

* create a new field `skpm` in `package.json`

```json
 "skpm": {
   "main": "some-name.sketchplugin",
   "manifest": "manifest.json"
},
```

* Create `manifest.json` file with following content -

```json
{
  "compatibleVersion": 3,
  "bundleVersion": 1,
  "commands": [
    {
      "name": "react-sketchapp: some-name",
      "identifier": "main",
      "script": "./your-app-file.js"
    }
  ],
  "menu": {
    "isRoot": true,
    "items": ["main"]
  }
}
```

* add this to your `scripts` section of your `package.json`

```json
scripts: {
  "render": "skpm-build --watch --run",
}
```

and finally run `yarn render` to render the components to Sketch.

For a complete reference, checkout [this](https://github.com/airbnb/react-sketchapp/blob/master/examples/emotion/src) project setup.
npm package: @sampettersson/primitives-core
Description: Shared utilities for emotion primitives and native
Latest version: 9.2.12

# @emotion/primitives-core

> Shared utilities for emotion primitives and native

## Introduction

> Note: In most of the cases, you won't need this package and should use `@emotion/native` or `@emotion/primitives`.

This package contains some shared utilities which are consumed by `@emotion/primitives` and `@emotion/native` for styling and rendering components.

This package provides two functions, `createCss` and `createStyled`.

### `createCss(StyleSheet)`

`createCss` accepts a platform specific `StyleSheet` method for creating styles, and returns a function which accepts styles via string template literal and object literal notation.

```js
import { StyleSheet, View, Text } from 'react-native'
import { createCss } from '@emotion/primitives-core'

const css = createCss(StyleSheet)

<View style={css`background-color: red;`}><Text style={css`font-size: 40px;`}>Hello World</Text></View>
```

### `createStyled(StyleSheet)`

`createStyled` also accepts a platform specific `StyleSheet` method for creating styles. It returns a function to which primitives can be assigned for example - `View`, `Text`, and it returns a styled component.

```js
import { StyleSheet, View, Text } from 'react-native'
import { createStyled } from '@emotion/primitives-core'

const styled = createStyled(StyleSheet)

styled.Text = styled(Text)

const StyledText = styled.Text`font-size: 40px;`

<View><StyledText>Hello World</StyledText></View>
```
npm package: @sampettersson/react-dom-confetti
Description: react component for dom-confetti
Author: d-dog@d-dog.se
Latest version: 0.0.9

# react-dom-confetti

[![npm version](https://badge.fury.io/js/react-dom-confetti.svg)](https://www.npmjs.com/package/react-dom-confetti)

Trigger confetti explosions on state transitions:

```js
import Confetti from 'react-dom-confetti';

// in render
<Confetti active={ this.props.completed } />
```

This will trigger a confetti explision every time the prop `active` goes from a falsy to truthy value.

## Demo
[https://daniel-lundin.github.io/react-dom-confetti/](https://daniel-lundin.github.io/react-dom-confetti/)

## Why?
Slow operations annoy users and stakeholders. We have two options, either optimize slow operations or **make it worth the wait**. This library focus on the latter.

### Props

#### active

Required. Triggers an explosion when transitions from falsy to truthy.

#### config

Optional. Configuration object to control the characteristics of the confetti:

- `angle` - direction of the explosion in degrees, defaults to 90.
- `spread` - spread of the explosion in degrees,  deafults to 45.
- `startVelocity` - Initial velocity of the particles, defaults to 45.
- `elementCount` - Number of particle elements, default to 50.
- `decay` - Decrease in velocity per frame, defaults to 0.9

License MIT, copyright [Daniel Lundin](https://www.twitter.com/daniel-lundin) 2017