Skip to content

Commit

Permalink
explain methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Zazama committed Aug 31, 2022
1 parent 8bdf242 commit 3bf7d72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const tags = {
```

### Write tags to file
If you have an existing file/buffer (e.g. an mp3 file) you can use the write method to write your tags into it. It will remove existing tags and add yours.

```javascript
const success = NodeID3.write(tags, filepath) // Returns true/Error
// async version
Expand All @@ -47,7 +49,8 @@ NodeID3.write(tags, file, function(err, buffer) { })
```

### Update existing tags of file or buffer
This will write new/changed values but keep all others
The update method works like the write method but will keep or overwrite existing tags instead of removing them.

```javascript
const success = NodeID3.update(tags, filepath) // Returns true/Error
const success = NodeID3.update(tags, filebuffer) // Returns Buffer
Expand All @@ -67,6 +70,7 @@ NodeID3.update(tags, filebuffer, options, function(err, buffer) { })
```

### Create tags as buffer
The create method will return a buffer of your ID3-Tag. You can use it to e.g. write it into a file yourself instead of using the write method.
```javascript
const success = NodeID3.create(tags) // Returns ID3-Tag Buffer
// async version
Expand Down

0 comments on commit 3bf7d72

Please sign in to comment.