open-index/open-npm huggingface dataset:
npm package: @hiswe/koa-nuxt
Description: koa middleware for nuxt
Author: Hiswe
Latest version: 1.0.0

# koa-nuxt

[Koa 2](https://koajs.com/) middleware for [Nuxt 2](https://nuxtjs.org/)
This is mostly the same code as [create-nuxt-app – koa](https://github.com/nuxt/create-nuxt-app/blob/master/template/server/index-koa.js)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [why](#why)
- [koa-session caveats](#koa-session-caveats)
- [minimal example](#minimal-example)
- [extensive example](#extensive-example)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## why

It just:

- removes some boilerplate
- makes it possible to call the nuxt render in different places (like in an error handler)

## koa-session caveats

In order to use [koa-session](https://github.com/koajs/session) without having `Can't set headers after they are sent` errors you'll need to call it manually **before** calling the `renderNuxt` middleware

```js
const sessionConfig = {
  // don't autoCommit because we need to control when headers are send
  autoCommit: false,
}
app.use(session(sessionConfig, app))

app.use(async (ctx, next) => {
  ctx.session.now = new Date().valueOf()
  // ensure headers are sent before nuxt
  await ctx.session.manuallyCommit()
  // nuxt render can be safely be done after that
  await next()
})
```

## minimal example

```js
import Koa from 'koa'
import { Nuxt, Builder } from 'nuxt'
import koaNuxt from '@hiswe/koa-nuxt'

import nuxtConfig from '../nuxt.config.js'

const app = new Koa()
nuxtConfig.dev = !(app.env === `production`)

async function start() {
  const nuxt = new Nuxt(nuxtConfig)
  // create the nuxt middleWare
  const renderNuxt = koaNuxt(nuxt)

  // re-build with nuxt on development
  // this can take some time
  if (nuxtConfig.dev) {
    const builder = new Builder(nuxt)
    await builder.build()
  }

  // call the middleware in last position
  // it will take care of anything not handled by our app
  app.use(renderNuxt)

  // launch app
  app.listen(process.env.HOST || `127.0.0.1`, process.env.PORT || 3000)
}

start()
```

## extensive example

go see [this repository](https://github.com/Hiswe/koa-nuxt-example)
npm package: @hisystems/create-snowpack-app
Description: ``` npx create-snowpack-app new-dir --template @snowpack/app-template-NAME [--use-yarn | --use-pnpm] ```
Latest version: 1.7.2

# Create Snowpack App (CSA)

```
npx create-snowpack-app new-dir --template @snowpack/app-template-NAME [--use-yarn | --use-pnpm]
```

## Official App Templates

- [@snowpack/app-template-blank](../@snowpack/app-template-blank)
- [@snowpack/app-template-blank-typescript](../@snowpack/app-template-blank-typescript)
- [@snowpack/app-template-11ty](../@snowpack/app-template-11ty)
- [@snowpack/app-template-lit-element-typescript](../@snowpack/app-template-lit-element-typescript)
- [@snowpack/app-template-lit-element](../@snowpack/app-template-lit-element)
- [@snowpack/app-template-preact](../@snowpack/app-template-preact)
- [@snowpack/app-template-react-typescript](../@snowpack/app-template-react-typescript)
- [@snowpack/app-template-react](../@snowpack/app-template-react)
- [@snowpack/app-template-svelte-typescript](../@snowpack/app-template-svelte-typescript)
- [@snowpack/app-template-svelte](../@snowpack/app-template-svelte)
- [@snowpack/app-template-vue](../@snowpack/app-template-vue)

### Featured Community Templates

- [snowpack-template-preset-env](https://github.com/argyleink/snowpack-template-preset-env) (PostCSS + Babel)
- [11st-Starter-Kit](https://github.com/stefanfrede/11st-starter-kit) (11ty +
  Snowpack + tailwindcss)
- [app-template-reason-react](https://github.com/jihchi/app-template-reason-react) (ReasonML (BuckleScript) & reason-react on top of [@snowpack/app-template-react](/templates/app-template-react))
- [svelte-tailwind](https://github.com/agneym/svelte-tailwind-snowpack) (Adds PostCSS and TailwindCSS using [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess))
- [snowpack-react-tailwind](https://github.com/mrkldshv/snowpack-react-tailwind) (React + Snowpack + Tailwindcss)
- PRs that add a link to this list are welcome!
npm package: @hisystems/snowpack
Description: Run npm packages directly in the browser. No Webpack, Parcel, or bundlers required.
Latest version: 2.10.2

[![CI](https://github.com/pikapkg/snowpack/workflows/CI/badge.svg?event=push)](https://github.com/pikapkg/snowpack/actions)

### What is Snowpack?

**Snowpack is a modern, lightweight toolchain for web application development.** Traditional dev bundlers like webpack or Parcel need to rebuild & rebundle entire chunks of your application every time you save a single file. This introduces lag between changing a file and seeing those changes reflected in the browser, sometimes as slow as several seconds.

Snowpack solves this problem by serving your application **unbundled in development.** Any time you change a file, Snowpack never rebuilds more than a single file. There's no bundling to speak of, just a few milliseconds of single-file rebuilding and then an instant update in the browser via HMR. We call this new approach **O(1) Build Tooling.** You can read more about it in our [Snowpack 2.0 Release Post.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/) 

When you're ready to deploy your web application to users, you can add back a traditional bundler like Webpack or Parcel. With Snowpack you get bundled & optimized production performance without sacrificing dev speed by adding an unnecessary bundler, 

### Key Features

- A dev environment that starts up in **50ms or less.**
- Changes are reflected [instantly in the browser.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#hot-module-replacement)
- Integrates your favorite bundler for [production-optimized builds.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#snowpack-build)
- Out-of-the-box support for [TypeScript, JSX, CSS Modules and more.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#features)
- Connect your favorite tools with custom [build scripts](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#build-scripts) & [third-party plugins.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#build-plugins)

**💁 More info at the official [Snowpack website ➞](https://snowpack.dev)**
npm package: @hisystems/snowpack-app-template-11ty
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.7.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-blank
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.6.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-blank-typescript
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-lit-element
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm run build

Builds the app for production to the `dist/` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

## Directives

In case you need to add a directive like `classMap` you should add the extension to the import:

```
import { classMap } from "lit-html/directives/class-map.js";
```
npm package: @hisystems/snowpack-app-template-lit-element-typescript
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm run build

Builds the app for production to the `dist/` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.



## Directives

In case you need to add a directive like `classMap` you should add the extension to the import:

```
import { classMap } from "lit-html/directives/class-map.js";
```
npm package: @hisystems/snowpack-app-template-preact
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

### npm run build

Builds the app for production to the `build/` folder.
It correctly bundles Preact in production mode and optimizes the build for the best performance.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-react
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.9.4

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-react-typescript
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.10.3

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-svelte
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.11

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-svelte-typescript
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.11

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

### npm run build

Builds a static copy of your site to the `build/` folder.
Your app is ready to be deployed!

**For the best production performance:** Add a build bundler plugin like "@hisystems/snowpack-plugin-webpack" or "@hisystems/snowpack-plugin-parcel" to your `snowpack.config.json` config file.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-app-template-vue
Description: > ✨ Bootstrapped with Create Snowpack App (CSA).
Latest version: 1.8.10

# New Project

> ✨ Bootstrapped with Create Snowpack App (CSA).

## Available Scripts

### npm start

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

### npm test

**⚠️ NOTE:** Vue 3 testing support is still in progress. This template does not ship with a test runner.

### npm run build

Builds the app for production to the `build/` folder.
It correctly bundles Vue in production mode and optimizes the build for the best performance.

### Q: What about Eject?

No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.
npm package: @hisystems/snowpack-babel-plugin-package-import
Description: Babel plugin to rewrite package imports from their package name to their resolved `web_modules` URL. Uses the `import-map.json` file contained in each `web_modules/` directory to map each package.
Latest version: 1.1.3

# @hisystems/snowpack-babel-plugin-package-import

Babel plugin to rewrite package imports from their package name to their resolved `web_modules` URL. Uses the `import-map.json` file contained in each `web_modules/` directory to map each package.

```
npm install --save-dev @hisystems/snowpack-babel-plugin-package-import
```

```js
// babel.config.json / .babelrc
"plugins": [["@hisystems/snowpack-babel-plugin-package-import", { /* options */ }]]
```

## Plugin Options

> Note: All config options are optional.

- `webModulesUrl`: The hosted URL path reference for web_modules imports. Can be:
  - An absolute path ("/web_modules"). This is the default.
  - An absolute URL ("https://foobar.com/web_modules/")
  - A relative path prefix ("./web_modules", "../web_modules").
    NOTE: Relative paths are relative from the current working directory / Babel's "root".
- `webModulesDir`: The web_modules installed location on disk. Can be an absolute path, or relative to the current working directory.
  - Defaults to "\${cwd}/web_modules".
- `importMap`: The name/location of the "import-map.json" file generated by Snowpack.
  - Defaults to "\${webModulesDir}/import-map.json".
- `moduleResolution`: Control how the plugin rewrites relative/local imports. Defaults to "none".
  - `"none"`: Leave relative imports untouched.
  - `"node"`: Rewrite all relative paths to use node's built-in resolution, resolving things like missing file extensions and directory imports. This is useful to assist migrating an older, bundled project to Snowpack.
- `ignore`: Array of import specifiers to ignore and leave untouched / bare.
npm package: @hisystems/snowpack-plugin-babel
Description: Use Babel to build your files from source. Automatically inherits from your local project `.babelrc` or `babel.config.json` files.
Latest version: 2.1.1

# @hisystems/snowpack-plugin-babel

Use Babel to build your files from source. Automatically inherits from your local project `.babelrc` or `babel.config.json` files.

```
npm install --save-dev @hisystems/snowpack-plugin-babel
```

```js
// snowpack.config.json
{
  "plugins": [
    [
      "@hisystems/snowpack-plugin-babel",
      {
        "input": ['.js', '.mjs', '.jsx', '.ts', '.tsx'], // (optional) specify files for Babel to transform
        transformOptions: {
          // babel transform options
        }
      }
    ]
  ]
}
```

#### Plugin Options

| Name               | Type       | Description                                                                                                                                        |
| :----------------- | :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`            | `string[]` | (optional) By default, Babel scans & transfoms these extensions: `['.js', '.jsx', '.ts', '.tsx']`. Modify this array if you’d like to change this. |
| `transformOptions` | `object`   | (optional) See [https://babeljs.io/docs/en/options](https://babeljs.io/docs/en/options)                                                            |
npm package: @hisystems/snowpack-plugin-build-script
Description: A Snowpack plugin to build files in your application using any CLI tool. This plugin passes matching files as input to a custom CLI command and returns the output response as the build result. This is useful for connecting a custom CLI or when no Snowpack
Latest version: 2.0.7

# @snowpack/plugin-build-script

A Snowpack plugin to build files in your application using any CLI tool. This plugin passes matching files as input to a custom CLI command and returns the output response as the build result. This is useful for connecting a custom CLI or when no Snowpack plugin exists for a favorite build tool.

Note: All Snowpack < v2.6 `build:*` scripts now use this plugin behind the scenes.

Usage:

```bash
npm install @snowpack/plugin-build-script
```

Then add the plugin to your Snowpack config:

```js
// snowpack.config.js

module.exports = {
  plugins: [
    [
      '@snowpack/plugin-build-script',
      {
        input: ['.tsx'], // files to watch
        output: ['.tsx'], // files to export
        cmd: 'babel --filename $FILE', // cmd to run
      },
    ],
  ],
};
```

## Plugin Options

| Name     |    Type    | Description                                                                 |
| :------- | :--------: | :-------------------------------------------------------------------------- |
| `input`  | `string[]` | Array of extensions to watch for.                                           |
| `output` | `string[]` | Array of extensions this plugin will output.                                |
| `cmd`    |  `string`  | Command to run on every file matching `input`. Accepts the `$FILE` env var. |
npm package: @hisystems/snowpack-plugin-dotenv
Description: Use [dotenv](https://github.com/motdotla/dotenv) to load environment variables from your project `.env` files. See Snowpack's [Environment Variables](https://www.snowpack.dev/#environment-variables) documentation to learn more.
Latest version: 2.0.2

# @hisystems/snowpack-plugin-dotenv

Use [dotenv](https://github.com/motdotla/dotenv) to load environment variables from your project `.env` files. See Snowpack's [Environment Variables](https://www.snowpack.dev/#environment-variables) documentation to learn more.

```
npm install --save-dev @hisystems/snowpack-plugin-dotenv
```

```js
// snowpack.config.json
{
  "plugins": ["@hisystems/snowpack-plugin-dotenv"]
}
```

```
# .env
SNOWPACK_PUBLIC_ENABLE_FEATURE=true
```

**NOTE:** Snowpack requires the `SNOWPACK_PUBLIC_` prefix to recognize environment variables. This is to prevent accidental exposure of keys and secrets.

#### What is Supported?

- [dotenv-expand](https://github.com/motdotla/dotenv-expand)
- `.env.NODE_ENV.local`
- `.env.NODE_ENV`
- `.env`

#### Plugin Options

None
npm package: @hisystems/snowpack-plugin-parcel
Description: > NOTE: This plugin only works on Snowpack v2.6 or earlier. For bundling with the latest version of Snowpack, we recommend [@hisystems/snowpack-plugin-webpack](../plugin-webpack/) for a smaller build.
Latest version: 2.0.4

# @hisystems/snowpack-plugin-parcel

> NOTE: This plugin only works on Snowpack v2.6 or earlier. For bundling with the latest version of Snowpack, we recommend [@hisystems/snowpack-plugin-webpack](../plugin-webpack/) for a smaller build.

Use Parcel to bundle your application for production. Uses Parcel v1.

```
npm install --save-dev @hisystems/snowpack-plugin-parcel
```

```js
// snowpack.config.json
{
  "plugins": ["@hisystems/snowpack-plugin-parcel"]
}
```

⚠️ **NOTE:** Parcel v1.x does not support Snowpack's usage of `import.meta`. This means that `@hisystems/snowpack-plugin-parcel` won't work for Snowpack applications that make use of HMR (`import.meta.hot`) or custom environment variables (`import.meta.env`). If you need to use either, check out [@hisystems/snowpack-plugin-webpack](/packages/plugin-webpack) instead.

#### Default Build Script

```js
{
  "scripts": {"bundle:*": "@hisystems/snowpack-plugin-parcel"}
}
```

#### Plugin Options

None
npm package: @hisystems/snowpack-plugin-postcss
Description: Run [PostCSS](https://github.com/postcss/postcss) on all `.css` files, including ones generated from Sass, Vue, and Svelte.
Latest version: 1.0.3

# @hisystems/snowpack-plugin-postcss

Run [PostCSS](https://github.com/postcss/postcss) on all `.css` files, including ones generated from Sass, Vue, and Svelte.

### Usage

From a terminal, run the following:

```
npm install --save-dev @hisystems/snowpack-plugin-postcss postcss postcss-cli
```

Then add this plugin to your Snowpack config:

```js
// snowpack.config.json
{
  "plugins": [
    "@hisystems/snowpack-plugin-postcss"
  ]
}
```

Lastly, add a `postcss.config.js` file to the root of your project as you would normally:

```js
const cssnano = require('cssnano');
const postcssPresetEnv = require('postcss-preset-env');

module.exports = {
  plugins: [cssnano(), postcssPresetEnv()],
};
```

### Plugin Options

| Name     |    Type    | Description                                                                                                                                             |
| :------- | :--------: | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `input`  | `string[]` | File extensions to transform (default: `['.css']`)                                                                                                      |
| `config` |  `string`  | (optional) Set a custom path to your PostCSS config (in case PostCSS has trouble loading it automatically, or in case you want multiple PostCSS setups) |
npm package: @hisystems/snowpack-plugin-react-refresh
Description: Transforms JavaScript files containing React components automatically to enable React Fast Refresh via Snowpack's HMR API.
Latest version: 2.1.1

# @hisystems/snowpack-plugin-react-refresh

Transforms JavaScript files containing React components automatically to enable React Fast Refresh via Snowpack's HMR API. 

```
npm install --save-dev @hisystems/snowpack-plugin-react-refresh
```

## Setup

```js
// snowpack.config.json
{
  "plugins": ["@hisystems/snowpack-plugin-react-refresh"]
}
```

In addition, you have to add `react-refresh/babel` as a plugin to your babel configuration:

```js
// babel.config.json
{
  "env": {
    "development": {
      "plugins": [
        "react-refresh/babel"
      ]
    }
  }
}
```


## Plugin Options

None

## How it Works

This plugin will automatically inject HMR event handlers into any file containing a React component. 

In most applications, you'll still want some top-level `import.meta.hot` handling code in your application for any non-React file updates. In our Create Snowpack App templates, this would be the HMR handling snippet found in `src/index.js`.
npm package: @hisystems/snowpack-plugin-run-script
Description: Run any CLI command as a part of Snowpack’s dev server and production build. Useful for languages not supported by [Snowpack plugins](https://www.snowpack.dev/#build-plugins). This replaces the old `run:*` scripts in your Snowpack config.
Latest version: 2.1.2

# @snowpack/plugin-run-script

Run any CLI command as a part of Snowpack’s dev server and production build. Useful for languages not supported by [Snowpack plugins](https://www.snowpack.dev/#build-plugins). This replaces the old `run:*` scripts in your Snowpack config.

Usage:

```bash
npm i @snowpack/plugin-run-script
```

Then add the plugin to your Snowpack config:

```js
// snowpack.config.js

module.exports = {
  plugins: [
    [
      '@snowpack/plugin-run-script',
      {
        cmd: 'sass src/css:public/css --no-source-map', // production build command
        watch: 'sass --watch src/css:public/css --no-source-map', // (optional) dev server command
      },
    ],
  ],
};
```

Supply any CLI command in `cmd`. Note that this is the same as running the command yourself in your project root folder (i.e. you can reference any global packages as well as npm script).

## Plugin Options

| Name    |   Type   | Description                                                                   |
| :------ | :------: | :---------------------------------------------------------------------------- |
| `cmd`   | `string` | The CLI command to run. Note that this will run **before** Snowpack builds.   |
| `watch` | `string` | (optional) A watch command to run during the dev server.                      |
| `output` | `"stream" | "dashboard"` | (optional) Set how the output should be recorded during dev. |
npm package: @hisystems/snowpack-plugin-svelte
Description: Use the [Svelte compiler](https://svelte.dev/docs#Compile_time) to build your `.svelte` files from source.
Latest version: 2.0.5

# @hisystems/snowpack-plugin-svelte

Use the [Svelte compiler](https://svelte.dev/docs#Compile_time) to build your `.svelte` files from source.

```
npm install --save-dev @hisystems/snowpack-plugin-svelte
```

```js
// snowpack.config.json
{
  "plugins": [
    ["@hisystems/snowpack-plugin-svelte", { /* see “Plugin Options” below */ }]
  ]
}
```

#### Plugin Options

This plugin also supports all Svelte compiler options. See [here](https://svelte.dev/docs#svelte_compile) for a list of supported options.
npm package: @hisystems/snowpack-plugin-vue
Description: Use the [Vue 3 compiler](https://www.npmjs.com/package/@vue/compiler-sfc) to build your `.vue` SFC files from source.
Latest version: 2.1.2

# @hisystems/snowpack-plugin-vue

Use the [Vue 3 compiler](https://www.npmjs.com/package/@vue/compiler-sfc) to build your `.vue` SFC files from source.

```
npm install --save-dev @hisystems/snowpack-plugin-vue
```

```js
// snowpack.config.json
{
  "plugins": [
    "@hisystems/snowpack-plugin-vue"
  ]
}
```

#### Plugin Options

(none)
npm package: @hisystems/snowpack-plugin-webpack
Description: Use Webpack to bundle your application for production.
Latest version: 2.0.6

# @hisystems/snowpack-plugin-webpack

Use Webpack to bundle your application for production.

```
npm install --save-dev @hisystems/snowpack-plugin-webpack
```

```js
// snowpack.config.json
{
  "plugins": [["@hisystems/snowpack-plugin-webpack", { /* see "Plugin Options" below */}]]
}
```

#### Default Build Script

```js
{
  "scripts": {"bundle:*": "@hisystems/snowpack-plugin-webpack"}
}
```

### Plugin Options

- `sourceMap: boolean` - Enable sourcemaps in the bundled output.
- `outputPattern: {css: string, js: string, assets: string}` - Set the URL for your final bundled files. This is where they will be written to disk in the `build/` directory. See Webpack's [`output.filename`](https://webpack.js.org/configuration/output/#outputfilename) documentation for examples of valid values.
- `extendConfig: (config: WebpackConfig) => WebpackConfig` - extend your webpack config, see below.

#### Extending The Default Webpack Config

The `extendConfig` option is a function that you can provide to configure the default webpack config. If you provide this function, the plugin will pass its return value to `webpack.compile()`. Use this to make changes, add plugins, configure loaders, etc.

Note that this requires you use a `snowpack.config.js` JavaScript config file. JSON configuration cannot represent a function.

```js
// snowpack.config.js
module.exports = {
  plugins: [
    [
      "@hisystems/snowpack-plugin-webpack",
      {
        extendConfig: (config) => {
          config.plugins.push(/* ... */);
          return config;
        },
      },
    ],
  ],
};
```
npm package: @hitaboy/gridllery
Description: Grid gallery system
Latest version: 5.5.0

# gridllery
[![](https://img.shields.io/npm/v/@hitaboy/gridllery.svg)](https://github.com/hitaboy/gridllery)

Grid gallery system


Install
-------
```
npm install @hitaboy/gridllery
```

Usage
-------
```
import gridllery from '@hitaboy/gridllery'

```
npm package: @hitachi567/core
Description: basic interfaces, functions and classes for express app
Author: hitachi567
Latest version: 1.0.2

# Core

[hitachi567](https://github.com/hitachi567) <<a href="mailto:abidai790@gmail.com">abidai790@gmail.com</a>>

Wrapper for express based app

## Requirements

- node.js
- npm or yarn

## Getting started

```bash
npm install @hitachi567/core

# or

yarn add @hitachi567/core
```

## Usage

### Initialize express app

```typescript
import { initApp } from '@hitachi567/core'

const app = initApp({
  cookieSecret: 'secret',
})

app.listen(5000, () => console.log('listening on 5000...'))
```

### Define middleware

```typescript
import Lib from '@hitachi567/core'
import { Router } from 'express'

interface Body {
  username: string
  password: string
}

interface Locals extends Lib.Locals {
  hashedPassword: string
}

let tryPartOfMiddleware: Lib.Middleware<Body, Locals> = async (
  request,
  response,
  next,
) => {
  let hashedPassword = await Lib.Hashing.hashing(request.body.password)

  response.locals.hashedPassword = hashedPassword

  next()
}

let middleware1 = Lib.asyncMiddleware<Body, Locals>(tryPartOfMiddleware)

let middleware2: Lib.Middleware<Body, Locals> = async (
  request,
  response,
  next,
) => {
  try {
    await tryPartOfMiddleware(request, response, next)
  } catch (error) {
    next(error)
  }
}

function middleware3(): Lib.Middleware<Body, Locals> {
  return Lib.asyncMiddleware<Body, Locals>(tryPartOfMiddleware)
}

// the expressions below are equivalent to each other
Router().use(middleware1)
Router().use(middleware2)
Router().use(middleware3())
```

## Links

- [github.com](https://github.com/hitachi567/core)
- [npmjs.com](https://www.npmjs.com/package/@hitachi567/core)
npm package: @hitachi567/subdomain
Description: middleware for handle request from subdomain
Author: hitachi567
Latest version: 1.0.0

# Subdomain

[hitachi567](https://github.com/hitachi567) <<a href="mailto:abidai790@gmail.com">abidai790@gmail.com</a>>

Express middleware for handle request from subdomain

## Requirements

- node.js
- npm or yarn

## Getting started

```bash
npm install @hitachi567/subdomain

# or

yarn add @hitachi567/subdomain
```

## Usage

```javascript
import subdomain from '@hitachi567/subdomain';
import express from 'express';

let app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

app.set('subdomain offset', 3); // mydomain.tld.com
app.set('subdomain offset', 2); // mydomain.com
app.set('subdomain offset', 1); // localhost

app.use(subdomain(
    (req, res) => res.send(req.hostname),
    ['api', 'users']
));

app.use(subdomain(
    (req, res) => res.send(req.hostname),
    ['api', 'posts']
));

app.use(subdomain(
    (req, res) => res.send(req.hostname)
));

app.listen(5000, () => {
    console.log('Server started on http://localhost:5000')
});
```

## Links

- [https://github.com/hitachi567/subdomain](https://github.com/hitachi567/subdomain)
- [https://www.npmjs.com/package/@hitachi567/subdomain](https://www.npmjs.com/package/@hitachi567/subdomain)