open-index/open-npm huggingface dataset:
npm package: @rpidanny/nepse.js
Description: Fetch stock data from Nepal Stock Exchange
Author: Abhishek
Latest version: 2.1.0

# nepse.js

Fetch stock data from Nepal Stock Exchange.

## Usage

```ts
import got from 'got'
import { Nepse } from '../src/nepse'

;(async () => {
  const nepse = new Nepse(got)

  console.log(await nepse.getDetails('2019-10-21'))
})()
```

## Examples

- [Get Stock Details](./examples/get-stock-details.ts)
- [Download CSVs](./examples/download-csv.ts)

You can run the example scripts using the following command:

```bash
$(npm bin)/ts-node examples/download-csv.ts
```
npm package: @rpidanny/odysseus
Description: Odysseus is a web scraping library built on top of Playwright, designed to handle dynamic web pages and CAPTCHA challenges with ease.
Author: Abhishek
Latest version: 2.6.0

# Odysseus

Odysseus is a web scraping library built on top of Playwright, designed to handle dynamic web pages and CAPTCHA challenges with ease.

> Odysseus was renowned for his cunning and resourcefulness. This library employs cunning strategies to navigate through dynamic web content and extract desired information.

## Highlights

- **Dynamic Content Handling**: Efficiently scrapes web pages with dynamic content rendered by JavaScript.
- **Retry Mechanism**: Automatically retries fetching content on failure, with configurable retry attempts.
- **Configurable Delays**: Allows setting custom delays for waiting after page loads.
- **Logging Support**: Integrates with custom logging mechanisms for debugging and monitoring.
- **CAPTCHA Handling**: Supports [human-in-the-loop](https://www.ctwo.com/article/human-in-the-loop-the-key-to-lasting-automation-success#:~:text=With%20human%2Din%2Dthe%2D,to%20enhance%20quality%20and%20efficiency.) [CAPTCHA](https://en.wikipedia.org/wiki/CAPTCHA) handling for uninterrupted scraping.

## Install

```sh
$ npm i @rpidanny/odysseys
```

## Usage

Here's a basic example to get you started:

```ts
import { Quill } from '@rpidanny/quill'
import { Odysseus } from '@rpidanny/odysseus'

// Configuration object
const config: IConfig = {
  headless: false, // Runs browser in non-headless mode
  delay: 5000, // Wait for 5 seconds after page loads
  retry: 5, // Retry fetching content up to 5 times
  waitOnCaptcha: true, // Wait for user action when captcha is detected
}

// Optional logger
const logger = new Quill()

// Create an instance of Odysseus
const odysseus = new Odysseus(config, logger)

// Initialize odysseus
await odysseus.init()

async function fetchContent(url: string, delay: number) {
  try {
    const content = await odysseus.getContent(url, delay)
    console.log(content)
  } catch (error) {
    console.error('Failed to fetch content:', error)
  }
}

// Each fetchContent opens a new tab so can be run concurrently
await Promise.all([
  fetchContent('https://www.tiktok.com/explore', 6_000),
  fetchContent('https://www.tiktok.com/explore', 6_000),
  fetchContent('https://www.tiktok.com/explore', 6_000),
])

await odysseus.close()
```

## API Documentation

The API Docs can be found [here](docs/API.md).

## License

This project is licensed under the MIT License.

---

Feel free to contribute to the project or report issues on the [GitHub repository](https://github.com/rpidanny/odysseus). Happy scraping!
npm package: @rpidanny/pdf2md
Description: A PDF to Markdown Converter
Author: Abhishek Maharjan
Latest version: 1.0.0

# pdf2md

JavaScript npm library to parse PDF files and convert them into Markdown

## Major Changes

See [Releases](https://github.com/rpidanny/pdf2md/releases)

## Usage

### Library

```js
const fs = require("fs");
const pdf2md = require("@rpidanny/pdf2md");

const pdfBuffer = fs.readFileSync(filePath);
pdf2md(pdfBuffer, callbacks)
  .then((text) => {
    let outputFile = allOutputPaths[i] + ".md";
    console.log(`Writing to ${outputFile}...`);
    fs.writeFileSync(path.resolve(outputFile), text);
    console.log("Done.");
  })
  .catch((err) => {
    console.error(err);
  });
```

### CLI tool

```
$ cd [project_folder]
$ npx @rpidanny/pdf2md --inputFolderPath=[your input folder path] --outputFolderPath=[your output folder path] --recursive
```

If you are converting recursively on a large number of files you might encounter the error "Allocation failed - JavaScript heap out of memory”. Instead, run the command

```
$ node lib/pdf2md-cli.js --max-old-space-size=4096 --inputFolderPath=[your input folder path] --outputFolderPath=[your output folder path] --recursive
```

Options:

1. Input folder path (should exist)
2. Output folder path (should exist)
3. Recursive - convert all PDFs for folders within folders. Specify the tag if you require recursive, and omit if you don't

## Credits

[pdf-to-markdown](https://github.com/jzillmann/pdf-to-markdown) - original project by Johannes Zillmann  
[pdf.js](https://mozilla.github.io/pdf.js/) - Mozilla's PDF parsing & rendering platform which is used as a raw parser