{
  "source": "doc/api/string_decoder.md",
  "modules": [
    {
      "textRaw": "StringDecoder",
      "name": "stringdecoder",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>To use this module, do <code>require(&#39;string_decoder&#39;)</code>. StringDecoder decodes a\nbuffer to a string. It is a simple interface to <code>buffer.toString()</code> but provides\nadditional support for utf8.</p>\n<pre><code class=\"lang-js\">const StringDecoder = require(&#39;string_decoder&#39;).StringDecoder;\nconst decoder = new StringDecoder(&#39;utf8&#39;);\n\nconst cent = new Buffer([0xC2, 0xA2]);\nconsole.log(decoder.write(cent));\n\nconst euro = new Buffer([0xE2, 0x82, 0xAC]);\nconsole.log(decoder.write(euro));\n</code></pre>\n",
      "classes": [
        {
          "textRaw": "Class: StringDecoder",
          "type": "class",
          "name": "StringDecoder",
          "meta": {
            "added": [
              "v0.1.99"
            ]
          },
          "desc": "<p>Accepts a single argument, <code>encoding</code> which defaults to <code>&#39;utf8&#39;</code>.</p>\n",
          "methods": [
            {
              "textRaw": "decoder.end()",
              "type": "method",
              "name": "end",
              "meta": {
                "added": [
                  "v0.9.3"
                ]
              },
              "desc": "<p>Returns any trailing bytes that were left in the buffer.</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "decoder.write(buffer)",
              "type": "method",
              "name": "write",
              "meta": {
                "added": [
                  "v0.1.99"
                ]
              },
              "desc": "<p>Returns a decoded string.</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "buffer"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "StringDecoder"
    }
  ]
}
