FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/example/clone.js at v0.2.1 · nodegit/nodegit · GitHub
nodegit
nodegit
Repository navigation
Code
Issues
344
(344)
Pull requests
21
(21)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
example
/
clone.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (28 loc) · 892 Bytes
Breadcrumbs
nodegit
/
example
/
clone.js
Copy path
File metadata and controls
30 lines (28 loc) · 892 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var
nodegit
=
require
(
'../'
)
;
var
promisify
=
require
(
"promisify-node"
)
;
var
fse
=
promisify
(
require
(
"fs-extra"
)
)
;
var
path
=
"/tmp/nodegit-clone-demo"
;
fse
.
remove
(
path
)
.
then
(
function
(
)
{
var
entry
;
nodegit
.
Clone
.
clone
(
"https://github.com/nodegit/nodegit.git"
,
path
,
{
ignoreCertErrors
:
1
}
)
.
then
(
function
(
repo
)
{
return
repo
.
getCommit
(
'59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5'
)
;
}
)
.
then
(
function
(
commit
)
{
return
commit
.
getEntry
(
'README.md'
)
}
)
.
then
(
function
(
entryResult
)
{
entry
=
entryResult
;
return
entry
.
getBlob
(
)
;
}
)
.
done
(
function
(
blob
)
{
console
.
log
(
entry
.
filename
(
)
,
entry
.
sha
(
)
,
blob
.
rawsize
(
)
+
'b'
)
;
console
.
log
(
'========================================================\n\n'
)
;
var
firstTenLines
=
blob
.
toString
(
)
.
split
(
'\n'
)
.
slice
(
0
,
10
)
.
join
(
'\n'
)
;
console
.
log
(
firstTenLines
)
;
console
.
log
(
'...'
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL