open-index/open-npm huggingface dataset:
npm package: @logue/wasmc
Description: Simplifies building of WebAssembly modules from C and C++
Author: rsms
Latest version: 2.2.2

# wasmc

Simplifies building of WebAssembly modules from C and C++

- Handles compiling, linking and packaging of C and C++ WASM/JS projects
- Zero dependencies -- portable single-file program
- Includes `rollup` and `uglify` functionality, producing very small products

## Usage

```plain
usage: wasmc [options] [<dir>]
usage: wasmc [-C <dir>] -T<tool> [<tool-arg> ...]
options:
  -debug, -g       Disable optimizations and include data for debuggers.
  -watch, -w       Watch source files and rebuild as needed.
  -config <file>   Load config file from <file> instead of <dir>/wasmc.js
  -clean           Rebuild even when product and sources are up to date.
  -quiet, -q       Do not print information to stdout except for warnings and errors
  -help, -h        Show help message and exit
  -C <dir>         Change working directory; as if wasmc was invoked from <dir>.
  -T<tool>         Run <tool> instead of building. -T for list of tools.

<dir>
  The module directory. Defaults to "." (dirname(<file>) with -config)
```

### Example

> See the [`example`](examples/example/) directory for a complete example.

Input `foo.c`:

```c
#include <stdio.h>
export void hello() {
  printf("Hello from wasm\n");
}
```

Input `foo.js`:

```js
export const ready = Module.ready;
export function hello() {
  _hello(); // Call WASM function "hello"
}
```

Config file `wasmc.js`

```js
module({
  name: "foo",
  out: "dist/foo.js",
  jsentry: "foo.js",
  sources: "*.c",
});
```

Build:

```sh
\$ wasmc
```

Generated `dist/foo.js`:

```js
(function (exports) {
  "use strict";
  // -- emscripten bootstrap code here --
  Object.defineProperty(exports, "__esModule", { value: !0 });
  exports.ready = Module.ready;
  exports.hello = function () {
    _hello();
  };
})(typeof exports != "undefined" ? exports : (this["foo"] = {}));
//# sourceMappingURL=foo.js.map
```

Run:

```sh
$ node -e 'require("./out/foo.js").ready.then(m => m.hello())'
Hello from wasm
```

### Configuration file

wasmc looks for `wasmc.js` in the project directory and evaluates it.

You can define modules (WASM products) and "libs" (collection of C and/or C++ files
compiled with certain flags) in this file.

- See [`examples/example/wasmc.js`](examples/example/wasmc.js) for an example.
- See [`misc/config-file.d.ts`](misc/config-file.d.ts) for a complete API description of the configuration file.

## Building from source

```sh
npm install
./misc/build.sh
```

- Release product: `wasmc`
- Debug product: `wasmc.g`
- Build only the debug product: `./misc/build.sh -g`
- Build debug product while watching source files: `./misc/build.sh -w`
npm package: @logui/nodejs
Description: Universal logging solution for React and Node.js applications.
Author: Zexware
Latest version: 1.0.3

# Logui Node.js SDK

Universal logging solution for React and Node.js applications.

## Installation

```bash
npm install @logui/nodejs
```

## Usage

### Node.js

```js
const { Logui } = require("@logui/nodejs");
Logui.init({ apiKey: "your-api-key", apiUrl: "http://localhost:3000" });
```

## Features

- Console and error interception
- Buffering and batch sending
- Works in browser and Node.js
- React ErrorBoundary support
npm package: @logui/react
Description: Universal logging solution for React and Node.js applications.
Author: Zexware
Latest version: 1.0.3

# @logui/react

Official React SDK for LogUI - Simple, powerful logging for React and Next.js applications.

## Features

- **React Provider Pattern**: Easy integration with React context
- **React Hooks**: `useLogui` hook for functional components
- **Error Boundaries**: Automatic React error capture and reporting
- **Client-Side Context**: Captures browser information, URL, viewport, etc.
- **Console Interception**: Optionally intercepts browser console methods
- **TypeScript Support**: Full TypeScript definitions included

## Installation

```bash
npm install @logui/react
```

## Quick Start

### 1. Wrap your app with LoguiProvider

```jsx
import { LoguiProvider } from "@logui/react";

export default function App({ Component, pageProps }) {
  return (
    <LoguiProvider
      apiKey="your-api-key-here"
      apiUrl="https://api.logui.xyz"
    >
      <Component {...pageProps} />
    </LoguiProvider>
  );
}
```

### 2. Use the hook in your components

```jsx
import { useLogui } from "@logui/react";

function MyComponent() {
  const logui = useLogui();

  const handleClick = () => {
    logui.info("Button clicked", {
      component: "MyComponent",
      action: "button_click",
    });
  };

  return <button onClick={handleClick}>Click me</button>;
}
```

## Configuration

```jsx
<LoguiProvider
  apiKey="your-api-key"
  apiUrl="https://api.logui.xyz"
  metadata={{
    environment: "production",
    version: "1.2.3",
    app: "my-react-app",
  }}
  captureConsole={true}
  captureErrors={true}
  fallback={<div>Error occurred</div>}
>
  {children}
</LoguiProvider>
```

## Logging Methods

```jsx
const logui = useLogui();

logui.debug("Debug message", { data: "value" });
logui.info("Info message", { data: "value" });
logui.warn("Warning message", { data: "value" });
logui.error("Error message", { data: "value" });
```

## Automatic Features

- **Error Boundaries**: React errors are automatically captured
- **Console Interception**: Console methods can be intercepted when enabled
- **Client Context**: Browser info, URL, viewport, and more are automatically captured

## Framework Support

-  Next.js (App Router & Pages Router)
-  Create React App
-  Vite
-  Any React application

## Full Documentation

For comprehensive documentation, advanced usage, and examples, visit:

**[docs.logui.xyz/sdk/react](https://docs.logui.xyz/sdk/react)**

## Links

- [Documentation](https://docs.logui.xyz)
- [GitHub Repository](https://github.com/zexware/logui)
- [Website](https://logui.xyz)

## License

MIT