---
layout: default
menu_item: api
title: Revparse
description: Version 0.26.1
menu_item: api
return_to:
"API Documentation Index": /api/
sections:
"ext": "#ext"
"single": "#single"
"MODE": "#MODE"
---
## Revparse.ext Sync
```js
var result = Revparse.ext(object_out, reference_out, repo, spec);
```
| Parameters | Type | |
| --- | --- | --- |
| object_out | [Object](/api/object/) | pointer to output object |
| reference_out | [Reference](/api/reference/) | pointer to output reference or NULL |
| repo | [Repository](/api/repository/) | the repository to search in |
| spec | String | the textual specification for an object |
| Returns | |
| --- | --- |
| Number | 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC
or an error code |
## Revparse.single Async
```js
Revparse.single(repo, spec).then(function(object) {
// Use object
});
```
| Parameters | Type | |
| --- | --- | --- |
| repo | [Repository](/api/repository/) | the repository to search in |
| spec | String | the textual specification for an object |
| Returns | |
| --- | --- |
| [Object](/api/object/) | |
## Revparse.MODE ENUM
| Flag | Value |
| --- | --- | --- |
| Revparse.MODE.SINGLE | 1 |
| Revparse.MODE.RANGE | 2 |
| Revparse.MODE.MERGE_BASE | 4 |