Skip to content

Commit 377f0b1

Browse files
committed
Update README.md
Adds libtag1-dev dependency, adds JS code blocks
1 parent 486aabb commit 377f0b1

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

README.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ node-taglib
44
node-taglib is a simple binding to
55
[TagLib](http://developer.kde.org/~wheeler/taglib/) in Javascript.
66

7-
It requires [node.js](http://nodejs.org).
7+
It requires [node.js](http://nodejs.org) and taglib header files (on Debian systems, install `libtag1-dev`).
88

99
node-taglib offers only an abstract interface without giving access to extended
1010
file-specific attributes. It does allow custom resolvers though. Synchronous
@@ -17,26 +17,28 @@ certain bugs present in the released v1.7 cause problems.**
1717

1818
## Example
1919

20-
// load the library
21-
var taglib = require('taglib');
20+
```js
21+
// load the library
22+
var taglib = require('taglib');
2223

23-
// asynchronous API
24-
taglib.tag(path, function(err, tag) {
25-
tag.artist; // => "Queen"
26-
tag.title = "Erm";
27-
tag.saveSync();
28-
});
24+
// asynchronous API
25+
taglib.tag(path, function(err, tag) {
26+
tag.artist; // => "Queen"
27+
tag.title = "Erm";
28+
tag.saveSync();
29+
});
2930

30-
// synchronous API
31-
var tag = taglib.tagSync(path);
31+
// synchronous API
32+
var tag = taglib.tagSync(path);
3233

33-
tag.title; // => "Another one bites the dust"
34-
tag.artist; // => "Kween"
35-
tag.artist = "Queen";
34+
tag.title; // => "Another one bites the dust"
35+
tag.artist; // => "Kween"
36+
tag.artist = "Queen";
3637

37-
tag.isEmpty(); // => false
38+
tag.isEmpty(); // => false
3839

39-
tag.saveSync(); // => true
40+
tag.saveSync(); // => true
41+
```
4042

4143
## Installation
4244

0 commit comments

Comments
 (0)