Skip to content

add example code to decode torrent file #162

@milahu

Description

@milahu

the readme has examples only to decode strings, but not files

import fs from 'fs'
import bencode from 'bencode'

var buffer = fs.readFileSync('input.torrent')
var objectUtf8 = bencode.decode(buffer, 'utf8')
console.log(objectUtf8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions