open-index/open-npm huggingface dataset:
npm package: @izhank216/commonts
Description: CommonTS (`commonts`) is a small Node.js utility that enables **global `require()` support in TypeScript projects**, even when using ES modules.
Latest version: 1.2.0

# CommonTS

CommonTS (`commonts`) is a small Node.js utility that enables **global `require()` support in TypeScript projects**, even when using ES modules.

---

## Installation


`npm install @izhank216/commonts typescript ts-node`

## Usage

1. *Create commonts.config.js in your project:*

```js
import "@izhank216/commonts/register";

export default {
    // Optional configuration
    allowRequire: true,
    transpileOnFly: true
};



2. *Import commonts.config.js first in your entry TypeScript file:*


import "./commonts.config.js";

const fs = require("fs"); // Works now
console.log(fs.readdirSync("."));

const path = require("path");
console.log(path.resolve("."));
npm package: @izhank216/content-types-fetch-pull
Description: A faster, clean fetch library
Latest version: 1.0.9

## Usage (ESM)
```javascript
import { fetchPull, encode, decode } from '@izhank216/content-types-fetch-pull';

async function main() {
  // GET request
  const todo = await fetchPull('https://jsonplaceholder.typicode.com/todos/1');
  console.log(todo);

  // POST request with JSON
  const newTodo = await fetchPull('https://jsonplaceholder.typicode.com/todos', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ title: 'Test', completed: false }),
  });
  console.log(newTodo);

  // Encode/decode
  const encoded = encode('Hello World');
  const decoded = decode(encoded);
  console.log(decoded);
}

main();
```

## Usage (CJS)

```javascript
const { fetchPull, encode, decode } = require('@izhank216/content-types-fetch-pull');

(async () => {
  // GET request
  const todo = await fetchPull('https://jsonplaceholder.typicode.com/todos/1');
  console.log(todo);

  // POST request with JSON
  const newTodo = await fetchPull('https://jsonplaceholder.typicode.com/todos', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ title: 'Test', completed: false }),
  });
  console.log(newTodo);

  // Encode/decode
  const encoded = encode('Hello World');
  const decoded = decode(encoded);
  console.log(decoded);
})();
```

## Usage (Browser)

Include the library from jsDelivr:

```javascript
<script src="https://cdn.jsdelivr.net/npm/@izhank216/content-types-fetch-pull@1.0.9/dist/content-types-fetch-pull.browser.js"></script>
<script>
  // Access via the UMD global object
  const { fetchPull, encode, decode } = ContentTypesFetchPull;

  async function main() {
    // GET request
    const todo = await fetchPull('https://jsonplaceholder.typicode.com/todos/1');
    console.log(todo);

    // POST request with JSON
    const newTodo = await fetchPull('https://jsonplaceholder.typicode.com/todos', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ title: 'Test', completed: false }),
    });
    console.log(newTodo);

    // Encode/decode
    const encoded = encode('Hello World');
    const decoded = decode(encoded);
    console.log(decoded);
  }

  main();
</script>
```