FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/examples/clone.js at master · nodegit/nodegit · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nodegit
/
nodegit
Public
Notifications
You must be signed in to change notification settings
Fork
700
Star
5.8k
Code
Issues
343
Pull requests
20
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
examples
/
clone.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (37 loc) · 1.03 KB
Breadcrumbs
nodegit
/
examples
/
clone.js
Copy path
File metadata and controls
39 lines (37 loc) · 1.03 KB
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
31
32
33
34
35
36
37
38
39
var
nodegit
=
require
(
"../"
)
;
var
fse
=
require
(
"fs-extra"
)
;
var
path
=
"/tmp/nodegit-clone-demo"
;
fse
.
remove
(
path
)
.
then
(
function
(
)
{
var
entry
;
nodegit
.
Clone
(
"https://github.com/nodegit/nodegit.git"
,
path
,
{
fetchOpts
:
{
callbacks
:
{
certificateCheck
:
function
(
)
{
// github will fail cert check on some OSX machines
// this overrides that check
return
0
;
}
}
}
}
)
.
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
.
name
(
)
,
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