open-index/open-npm huggingface dataset:
npm package: @sorafujitani/vp-config
Description: Vite Plus configuration for @sorafujitani
Author: Sora Fujitani
Latest version: 0.1.3

# @sorafujitani/vp-config

Reusable [vite-plus](https://github.com/nicepkg/vite-plus) configuration providing shared **format**, **lint**, and **test** presets.

## Install

```bash
vp add -D @sorafujitani/vp-config
```

## Usage

### Basic — use all presets

```ts
// vite.config.ts
import { defineConfig } from "vite-plus";
import { fmt, lint, test } from "@sorafujitani/vp-config";

export default defineConfig({
  fmt,
  lint,
  test,
});
```

### With staged (pre-commit auto-fix)

```ts
// vite.config.ts
import { defineConfig } from "vite-plus";
import { fmt, lint, test } from "@sorafujitani/vp-config";

export default defineConfig({
  staged: {
    "*": "vp check --fix",
  },
  fmt,
  lint,
  test,
});
```

### Cherry-pick individual presets

You can import only the presets you need:

```ts
import { defineConfig } from "vite-plus";
import { fmt } from "@sorafujitani/vp-config";

export default defineConfig({
  fmt,
  // bring your own lint / test config
});
```

### Override or extend a preset

Spread the preset and override specific fields:

```ts
import { defineConfig } from "vite-plus";
import { fmt, lint, test } from "@sorafujitani/vp-config";

export default defineConfig({
  fmt: {
    ...fmt,
    printWidth: 120,
    singleQuote: true,
  },
  lint: {
    ...lint,
    rules: {
      ...lint.rules,
      "no-magic-numbers": "off",
    },
  },
  test: {
    ...test,
    include: [...test.include, "tests/**/*.test.ts"],
  },
});
```

### With `vp pack` (library build)

If you are also building a library with `vp pack`, combine with a tsdown config:

```ts
// vite.config.ts
import { defineConfig } from "vite-plus";
import { fmt, lint, test } from "@sorafujitani/vp-config";
import tsdownConfig from "./tsdown.config.ts";

export default defineConfig({
  fmt,
  lint,
  test,
  pack: tsdownConfig,
});
```

## Preset Details

### `fmt` — Format

Opinionated Prettier-compatible defaults:

- Double quotes, semicolons, trailing commas (`"all"`)
- 2-space indent, 80 char print width, LF line endings
- Auto-sorted imports and `package.json`

### `lint` — Lint

OxLint configuration with TypeScript-first rules:

- **Plugins**: `typescript`, `unicorn`, `oxc`, `import`, `promise`
- **Type-aware** checking enabled (`typeAware: true`, `typeCheck: true`)
- **Categories**: `correctness` → error, `pedantic` / `perf` / `style` / `suspicious` → warn
- Strict TypeScript rules (`no-explicit-any` as error, consistent type imports/exports)
- Import hygiene (`no-cycle`, `no-duplicates`, `no-self-import`)
- CJS overrides for `.cjs` files

### `test` — Test

Vitest include pattern:

- `src/**/*.test.ts`
- `index.test.ts`

## Development

```bash
vp pack              # Build
vp pack --watch      # Build in watch mode
vp test              # Run tests
vp check             # Format, lint, and type check
vp exec bumpp        # Release with bumpp
```

## License

[MIT](./LICENSE)
npm package: @soral/string-pixel-width
Description: String pixel width measurement on the backend in Javascript
Author: soraliu
Latest version: 1.12.3

# [@soral/string-pixel-width](https://github.com/soraliu/string-pixel-width)

[![npm version](https://img.shields.io/npm/v/@soral/string-pixel-width.svg?style=flat-square)](https://www.npmjs.com/package/@soral/string-pixel-width)

String pixel width measurement on the backend in Javascript. Thanks to [string-pixel-width](https://www.npmjs.com/package/string-pixel-width)

## Installation

To install the stable version:

<code>
npm install --save @soral/string-pixel-width
</code>

## Supported fonts:

- Andale Mono
- Arial
- Avenir
- Avenir Next
- BlinkMacSystemFont
- Comic Sans MS
- Courier New
- Georgia
- Helvetica
- Impact
- Times New Roman
- Trebuchet MS
- Verdana
- Webdings
- Open Sans
- Tahoma

## Example

```javascript
var { pixelWidth } = require('@soral/string-pixel-width')

const width = pixelWidth('My text ...', { size: 10 })
console.log('This text is ' + width + 'px long in the size of 10px.') // This text is 43.5px long in the size of 10px.
```

```javascript
var { pixelWidth } = require('@soral/string-pixel-width')

const width = pixelWidth('My text ...', { font: 'impact', size: 10 })
console.log('This text is ' + width + 'px long in the size of 10px.') // This text is 42px long in the size of 10px.
```

```javascript
var { pixelWidth } = require('@soral/string-pixel-width')

const width = pixelWidth('My text ...', { font: 'open sans', size: 10, bold: true, italic: true })
console.log('This text is ' + width + 'px long in the size of 10px.') // This text is 47px long in the size of 10px using bold and italic proportions.
```

Custom Map

```javascript
var { pixelWidth } = require('@soral/string-pixel-width')

// map can be created by src/pixelWidthCalculator.html
const width = pixelWidth('My text ...', { font: 'custom', map: { ... } });
```

## How to contribute

PRs are welcome :)
This library uses static map of width of every ASCII letter for all supported fonts.

1. Clone the repository
2. Open file `src/pixelWidthCalculator.html` in your editor
3. Add your font name into array of fonts (currently var websafe) and save
4. Open up `src/pixelWidthCalculator.html` in Google Chrome. It should look like this:
   ![PHPStan](docs/string-pixel-width-1.png)
5. Map of withs will be generated for you - copy it and replace content of file `src/widthsMap.js`

**Please everytime make sure you don't broke existing fonts - remove any font or broke his widths.**
npm package: @soralinks/logger
Description: Logs info and verbose messages to stdout, warn and errors messages to stderr
Author: Tim Monroe
Latest version: 0.0.9

# logger
Logs info and verbose messages to stdout, warn and errors messages to stderr

## Install

`npm install @soralinks/logger`

## Use in your app

```javascript
import { Logger } from '@soralinks/logger';

// Turn on all logging: info, verbose, warning and error
let logger: Logger = new Logger({ logInfo: true, logVerbose: true, logWarning: true, logError: true });
logger.info(`logging some info: %s`, 'hello there!');
logger.verbose(`logging some verbose info: %s`, 'hello there again!');
logger.warn(`logging a warning: %s`, 'my warning message');
logger.error(`logging an error: %s`, 'my error message');

// Only turn on info and error logging
logger = new Logger({ logInfo: true, logError: true });
logger.info(`logging some info: %s`, 'hello there!');
logger.verbose(`logging some verbose info: %s`, 'hello there again!'); // this message will *not* get logged
logger.warn(`logging a warning: %s`, 'my warning message');  // this message will *not* get logged
logger.error(`logging an error: %s`, 'my error message');

```
npm package: @soralinks/news
Description: News utility
Author: Tim Monroe
Latest version: 0.0.34

# news
News utility

## Install

`npm install @soralinks/news`

## Use in your app

```javascript
import {
  NewsScraperType,
  NewsScraperSource,
  NewsScraperResponse
} from '@soralinks/news-scrapers';
import { News } from '@soralinks/news';

(async () => {
  const news = new News();
    const type = NewsScraperType.POLITICS;
    const sources = [...Object.values(NewsScraperSource).map(source => source)];
    const scraperResponses = await news.scrapeHeadlines(type, sources);
    console.log(`scraperResponses: ${JSON.stringify(scraperResponses, null, 2)}`);
})();
```

## Logging
```javascript
// To turn on logging, set the environment variable: LOGGING_NEWS = 'on'
// Note that error logging is always on

```
npm package: @soralinks/news-scrapers
Description: Scraping news organizations' websites for headlines
Author: Tim Monroe
Latest version: 0.0.37

# news-scrapers
Scraping news organizations' websites for headlines

## Install

`npm install @soralinks/news-scrapers`

## Use in your app

```javascript
import {
  NewsScraperType,
  NewsScraperResponse,
  NewsScraperFactory
} from '@soralinks/news-scrapers';

(async () => {
  const factory = new NewsScraperFactory();
  const scrapers = await factory.createScrapers();
  const results = await Promise.allSettled(
    scrapers.map(async (scraper) => {
      return scraper.scrape(NewsScraperType.POLITICS);
    }),
  );
  // @ts-ignore
  const scraperResponses: NewsScraperResponse[] = results.map(result => {
    if (result.status === 'fulfilled') {
      return result.value;
    }
    return undefined;
  }).filter(Boolean);
  console.log(`scraperResponses: ${JSON.stringify(scraperResponses, null, 2)}`);

})();
```

## Logging
```javascript
// To turn on logging, set the following environment variables:
//   LOGGING_ABC_SCRAPER = 'on'
//   LOGGING_AP_SCRAPER = 'on'
//   LOGGING_BBC_SCRAPER = 'on'
//   LOGGING_CNN_SCRAPER = 'on'
//   LOGGING_DISPATCH_SCRAPER = 'on'
//   LOGGING_CS_MONITOR_SCRAPER = 'on'
//   LOGGING_EPOCH_TIMES_SCRAPER='on'
//   LOGGING_FOX_SCRAPER = 'on'
//   LOGGING_NEWSNATION_SCRAPER = 'on'
//   LOGGING_NEWSWEEK_SCRAPER = 'on'
//   LOGGING_NY_POST_SCRAPER = 'on'
//   LOGGING_WASH_EXAM_SCRAPER = 'on'
//   LOGGING_WSJ_SCRAPER = 'on'
// Note that error logging is always on
```