webtorrent / webtorrent/node-bencode

add example code to decode torrent file

Open Beginner friendly
#162 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
173
Forks
38
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the README and review the existing examples that decode strings. Add a comparable example for reading and decoding a torrent file using the JavaScript shown in the issue, then verify the README clearly demonstrates file decoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.