mirror of
https://github.com/scratchfoundation/scratch-parser.git
synced 2025-08-28 22:18:45 -04:00
Update docs
This commit is contained in:
parent
85c61c09e9
commit
b0720fae03
1 changed files with 4 additions and 2 deletions
|
@ -18,16 +18,18 @@ npm install scratch-parser
|
|||
#### Basic Use
|
||||
```js
|
||||
var fs = require('fs');
|
||||
var scratchp = require('scratch-parser');
|
||||
var parser = require('scratch-parser');
|
||||
|
||||
var buffer = fs.readFileSync('/path/to/project.sb2');
|
||||
scratchp(buffer, function (err, project) {
|
||||
parser(buffer, function (err, project) {
|
||||
if (err) // handle the error
|
||||
// do something interesting
|
||||
});
|
||||
```
|
||||
|
||||
## Metadata
|
||||
The `scratch-parser` module will append metadata about the project should validation and parsing be successful. The `_meta` object includes:
|
||||
|
||||
| Key | Attributes |
|
||||
| ----------------- | -------------------------------------------------------- |
|
||||
| `scripts` | `count` |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue