Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
c2d24c23
Commit
c2d24c23
authored
Jan 26, 2016
by
Mehdy Dara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace "request" by "got"
* Less dependency * Use only stream
parent
60af985d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
package.json
package.json
+1
-1
install.js
scripts/install.js
+8
-16
No files found.
package.json
View file @
c2d24c23
...
...
@@ -55,12 +55,12 @@
"
gaze
"
:
"^0.5.1"
,
"
get-stdin
"
:
"^4.0.1"
,
"
glob
"
:
"^6.0.2"
,
"
got
"
:
"^5.4.1"
,
"
meow
"
:
"^3.3.0"
,
"
mkdirp
"
:
"^0.5.1"
,
"
nan
"
:
"^2.0.8"
,
"
node-gyp
"
:
"^3.0.1"
,
"
npmconf
"
:
"^2.1.2"
,
"
request
"
:
"^2.61.0"
,
"
sass-graph
"
:
"^2.0.1"
},
"devDependencies"
:
{
...
...
scripts/install.js
View file @
c2d24c23
...
...
@@ -7,7 +7,7 @@ var fs = require('fs'),
mkdir
=
require
(
'mkdirp'
),
npmconf
=
require
(
'npmconf'
),
path
=
require
(
'path'
),
request
=
require
(
'reques
t'
),
got
=
require
(
'go
t'
),
pkg
=
require
(
'../package.json'
);
require
(
'../lib/extensions'
);
...
...
@@ -31,9 +31,6 @@ function download(url, dest, cb) {
'or configure npm proxy via'
,
eol
,
eol
,
' npm config set proxy http://example.com:8080'
].
join
(
''
));
};
var
successful
=
function
(
response
)
{
return
response
.
statusCode
>=
200
&&
response
.
statusCode
<
300
;
};
applyProxy
({
rejectUnauthorized
:
false
},
function
(
options
)
{
options
.
headers
=
{
...
...
@@ -43,19 +40,14 @@ function download(url, dest, cb) {
].
join
(
''
)
};
try
{
request
(
url
,
options
,
function
(
err
,
response
)
{
if
(
err
)
{
reportError
(
err
);
}
else
if
(
!
successful
(
response
))
{
reportError
([
'HTTP error'
,
response
.
statusCode
,
response
.
statusMessage
].
join
(
' '
));
}
else
{
got
.
stream
(
url
,
options
)
.
on
(
'error'
,
function
(
error
)
{
reportError
(
error
);
})
.
on
(
'end'
,
function
()
{
cb
();
}
}).
on
(
'response'
,
function
(
response
)
{
if
(
successful
(
response
))
{
response
.
pipe
(
fs
.
createWriteStream
(
dest
));
}
});
})
.
pipe
(
fs
.
createWriteStream
(
dest
));
}
catch
(
err
)
{
cb
(
err
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment