Parse bittorrent "created by" strings into objects or die trying!
bittorrent-created-by tries really hard to parse the ugly and often confusing "created by" fields from torrent files. The definitions it uses were built by analysing a very large collection of torrent files found in the wild.
Code:
var parseCreatedBy = require("bittorrent-created-by");
var createdBy = parseCreatedBy("uTorrent/2210");
console.log(JSON.stringify(createdBy));
Output:
{"client":"uTorrent","version":"2210"}
Available via npm:
$ npm install bittorrent-created-by
Or via git:
$ git clone git://github.com/deoxxa/bittorrent-created-by.git node_modules/bittorrent-created-by
parseCreatedBy
This is the only thing exposed by this module.
parseCreatedBy(string);
var createdBy = parseCreatedBy("uTorrent/2210");
3-clause BSD. A copy is included with the source.
- GitHub (deoxxa)
- Twitter (@deoxxa)
- Email ([email protected])