‚̧Nucleic Photon Magnetizer
    Have ideas to improve npm?Join in the discussion! ¬Ľ

    @signalstickers/fetch-sticker-data-webpack-plugin
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0¬†‚Äʬ†Public¬†‚Äʬ†Published

    This Webpack plugin fetches sticker pack data from Signal at build-time, allowing the Signal Stickers website to load this data without having to fetch and decrypt it from the Signal API.

    Install

    npm i @signalstickers/fetch-sticker-data-webpack-plugin
    

    Use

    The plugin accepts 2 options, inputFile and outputFile. inputFile should be the path to a YAML file enumerating one or more StickerPackYaml objects. outputFile should be the desired path to a JSON file in the compilation's output directory where the plugin will wite a list of StickerPackPartial objects for each entry in inputFile.

    To enable the plugin, add it to your Webpack configuration:

    import FetchStickerDataPlugin from '@signalstickers/fetch-sticker-data-webpack-plugin';
     
    export default {
      plugins: [new FetchStickerDataPlugin({
        inputFile: 'stickers.yml',
        outputFile: 'sticker-partials.json'
      })]
    }

    Example:

    The following stickers.yml file will produce the below JSON output.

    stickers.yml

    ---
    ae1d343accdec586fe19954a6be7aee9:
      key: ffea9831b6af7617e4ab1b3868ce6f26f5c7c8ab3f05fb8d68b436f9253232ab
      source: ''
      tags:
        - cat
      nsfw: false

    sticker-partials.json

    {
      "meta": {
        "id":"ae1d343accdec586fe19954a6be7aee9",
        "key": "ffea9831b6af7617e4ab1b3868ce6f26f5c7c8ab3f05fb8d68b436f9253232ab",
        "source":"",
        "tags": [
          "cat"
        ],
        "nsfw":false
      },
      "manifest": {
        "title": "Taffy Cat",
        "author": "Dmitrii Nechitailo",
        "cover": {
          "id": 0,
          "emoji": ""
        }
      }
    }

    Keywords

    none

    Install

    npm i @signalstickers/fetch-sticker-data-webpack-plugin

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    WTFPL

    Unpacked Size

    19 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar