npm 中文文档 npm 中文文档
指南
npmjs.com (opens new window)
指南
npmjs.com (opens new window)
  • 快速入门

    • npm 是什么?
    • npm 安装和更新
    • npm 防止权限错误
    • npm package.json 文件
    • npm 安装包
    • npm 更新包
    • npm 卸载包
    • npm 创建 Node.js 模块
    • npm 发布和更新包
    • npm 使用语义化版本
    • npm 使用 Dist-tags 标记包
    • npm 包和模块的了解
  • 命令行
  • 配置 npm

Print.js


A tiny javascript library to help printing from the web.

For documentation and examples please visit: printjs.crabbly.com


Installation


You can download the latest version of Print.js from the GitHub releases or use the Print.js CDN available on the documentation page.

To install via npm:

  1. ``` shell
  2. npm install print-js --save
  3. ```

To install via yarn:

  1. ``` shell
  2. yarn add print-js
  3. ```

Import the library into your project:

  1. ``` js
  2. import printJS from 'print-js'
  3. ```

Documentation


You can find documentation at printjs.crabbly.com.

Contributing to Print.js


Contributions to Print.js are greatly welcomed and encouraged.

Using issues

The issue tracker is the preferred channel for reporting bugs, requesting new features and submitting pull requests.

Keep in mind that we would like to keep this a lightweight library.

Please do not use the issues channel for support requests. For help with using Print.js, please ask questions on Stack Overflow and use the tag printjs.

Reporting bugs

Well structured, detailed bug reports are hugely valuable for the project.

Check the issue search to see if it has already been reported.
Isolate the problem to a simple test case.
Create a codepen, fiddle, codesandbox or similar online example replicating the issue.

Please provide any additional details associated with the bug.

Pull requests

Clear, concise pull requests are excellent at continuing the project's community driven growth.

Please make your commits in logical sections with clear commit messages.

Setting up a dev environment

  1. ``` shell
  2. npm install
  3. npm run watch
  4. ```

Tests

The library is written following the Javascript Standard code style. When running tests, we will also test for any style issues or warnings.

Automated tests are written using the Jasmine framework and Karma runner.

To run the automated tests:

  1. ``` shell
  2. npm run test
  3. ```

To manually test the library features:

  1. ``` shell
  2. npm start
  3. ```

This will serve test\manual\test.html and open http://localhost:8080/test/manual in your default browser.

License


Print.js is available under the MIT license.
Last Updated: 2023-05-15 10:22:02