Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nodejs_tutorial
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jameschiu
nodejs_tutorial
Commits
571b971c
Commit
571b971c
authored
May 25, 2022
by
james
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] init
parent
bff7624c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
index.js
index.js
+12
-1
package.json
package.json
+4
-1
No files found.
index.js
View file @
571b971c
console
.
log
(
'
Hello World
'
);
\ No newline at end of file
const
puppeteer
=
require
(
'
puppeteer
'
);
(
async
()
=>
{
const
browser
=
await
puppeteer
.
launch
({
headless
:
false
// 無外殼的 Chrome,有更佳的效能
});
const
page
=
await
browser
.
newPage
();
await
page
.
goto
(
'
https://google.com
'
);
await
page
.
screenshot
({
path
:
'
example.png
'
});
await
browser
.
close
();
})();
\ No newline at end of file
package.json
View file @
571b971c
...
...
@@ -12,5 +12,8 @@
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"
ISC
"
"license"
:
"
ISC
"
,
"dependencies"
:
{
"
puppeteer
"
:
"
^14.1.1
"
}
}
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