open-index/open-npm huggingface dataset:
npm package: @gmetrixr/screenshot-glb
Description: A command line utility for taking screenshots of a glTF 2.0 binary file using Google's <model-viewer> component.
Author: Stephan Leroux
Latest version: 1.9.6

# 📸 screenshot-glb

Easily take screenshots and create thumbnail images for glTF 2.0 Binary (GLB) files.

## Install

Use npm to install this tool:

`npm install ---save @gmetrixr/screenshot-glb`

## Usage

To start taking screenshots of GLB files

```sh
$ screenshot-glb
Options:
  --help         Show help                                              [boolean]
  --version      Show version number                                    [boolean]
  -i, --input    Input glTF 2.0 binary (GLB) filepath                  [required]
  -o, --output   Output PNG screenshot filepath                        [required]
  -t, --timeout  Timeout length
  -w, --width    Output image width
  -h, --height   Output image height
  -c, --color    Change the background color of the rendered image
  -@, --model_viewer_version
                 Pass the version of Model Viewer which should be used .eg 1.9
  -m, --model_viewer_attributes
                 Pass <model-viewer> attributes as a URL search param string
  -q, --image_quality
                 Change the image quality of the rendered JPG default 0.92
```

## Dependencies

The module relies on using [puppeteer](https://www.npmjs.com/package/puppeteer) to spawn a headless instance of Chrome to render Google's [<model-viewer>](https://github.com/GoogleWebComponents/model-viewer) web component with the GLB model loaded.

## Development

For Shopify Employees

- `dev up`
- `yarn link`
- You may need to need to do `chmod 755 dist/cli.js` to allow for execution
- `screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE>`

Outside Development

- `yarn install`
- `yarn link`
- `screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE>`

## Examples

```
// Simply render a GLB to a JPG
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE>

// Change the width and height of the render
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE> --width 600 --height 1200

// Change the exposure and environment-image
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE> -m "environment-image=neutral&exposure=0.92"

// Use a specific version of Model Viewer to create the screenshot
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE> -@ 1.9
```

### Linux

You may need to install the following packages in order for the headless Chrome instance to work on headless Linux VM machines:

```
gconf-service
libasound2
libatk1.0-0
libatk-bridge2.0-0
libc6
libcairo2
libcups2
libdbus-1-3
libexpat1
libfontconfig1
libgcc1
libgconf-2-4
libgdk-pixbuf2.0-0
libglib2.0-0
libgtk-3-0
libnspr4
libpango-1.0-0
libpangocairo-1.0-0
libstdc++6
libx11-6
libx11-xcb1
libxcb1
libxcomposite1
libxcursor1
libxdamage1
libxext6
libxfixes3
libxi6
libxrandr2
libxrender1
libxss1
libxtst6
ca-certificates
fonts-liberation
libappindicator1
libnss3
lsb-release
xdg-utils
wget
```
npm package: @gmfe/babel-plugin-mobx-deep-action
Description: Allow to reduce boilerplate of writing async actions
Author: gmfe
Latest version: 1.7.1

# babel-plugin-mobx-deep-action

[![npm version](https://badge.fury.io/js/%40gmfe%2Fbabel-plugin-mobx-deep-action.svg)](https://badge.fury.io/js/%40gmfe%2Fbabel-plugin-mobx-deep-action)

假设，把动作内部创建的所有代码视为动作来处理，不用在单独使用 action 标记异步函数。

插件会扫描全部函数，标记 action，然后使用相应的 action 包裹其内部函数。

* [使用 async and generator 函数](#toc-usage-async)
* [Typescript 装饰模式](#toc-typescript-decorators)
* [使用其他包](#toc-mobx-package)

## 例子

**输入**

```js
import { action } from "mobx";

action(function doSome() {
  fetch("/api/list").then(function(response) {
    this.items = response.dta;
  });
});
```

**输出**

```js
"use strict";

import { action } from "mobx";

action(function doSome() {
  fetch("/api/list").then(action(function(response) {
    this.items = response.dta;
  }));
});
```

## 警告

插件支持 ES6 的 import，如果没有使用 makeAutoObserver 需要导入了 action 才能支持使用。

**如果使用了 makeAutoObserver 可以不用导入 action，我已处理。**

只支持以下导入方式，如下:
```
import {action} from "mobx";
```
```
import {action as actionAlias} from "mobx";
```
```
import * as mobx from "mobx";
```
```
import * as mobxAlias from "mobx";
```
这些例子，**不支持**:
```
const mobx = require("mobx")
```
```
const {action} = require("mobx")
```
```
import * as mobx from "my-mobx-alias"
```
```
import * as mobx from "mobx";
const {action} = mobx;
action(function() {});
```


## 安装

```sh
$ npm install babel-plugin-mobx-deep-action
```

## 使用

### 通过 `.babelrc` (推荐)

**.babelrc**

```json
{
  "plugins": ["mobx-deep-action"]
}
```

### 通过 babel 编译

```sh
$ babel --plugins mobx-deep-action script.js
```

### 通过 babel node api 编译

```javascript
require("babel-core").transform("code", {
  plugins: ["mobx-deep-action"]
});
```


## <a id="toc-usage-async"></a> 使用 async and generator 函数.

请看 https://github.com/Strate/babel-plugin-mobx-async-action

## <a id="toc-typescript-decorators"></a>Typescript 装饰模式.

本插件可以通过装饰代码来绑定，并输出 typescript，如下：

```js
import * as tslib_1 from "tslib";
import { action } from "mobx";
export default class Class2 {
    async method() {
        const a = (other) => { };
        return a(function () { });
    }
}
tslib_1.__decorate([
    action
], Class2.prototype, "method", null);
```

要使代码正常运行，你需要设置编译配置[importHelpers](https://www.typescriptlang.org/docs/handbook/compiler-options.html) 和安装依赖包[tslib](https://www.npmjs.com/package/tslib)。 并且, typescript 需要要输出 es6 modules，所以你应该把生产环境调到es2015+。插件会检查，如果导入了`tslib` 会绑定对应装饰代码。

## <a id="toc-mobx-package"></a> 使用其他包.

如果你使用了别名替换 mobx， 你快可以通过配置对应 plugin 的配置，如下：

#### .babelrc

```json5
{
  "plugins": [
    ["mobx-deep-action", {
      "mobx-package": "mobx-custom"
    }]
  ]
}
```