Back to template gallery

Empty JavaScript Project

Empty template with basic structure for the Actor with Apify SDK that allows you to easily add your own functionality.

Language

javascript

Tools

nodejs

Use cases

Web scraping

src/main.js

1// Apify SDK - toolkit for building Apify Actors (Read more at https://docs.apify.com/sdk/js/)
2import { Actor } from 'apify';
3// Crawlee - web scraping and browser automation library (Read more at https://crawlee.dev)
4// import { CheerioCrawler } from 'crawlee';
5
6// this is ESM project, and as such, it requires you to specify extensions in your relative imports
7// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions
8// import { router } from './routes.js';
9
10// The init() call configures the Actor for its environment. It's recommended to start every Actor with an init()
11await Actor.init();
12
13console.log('Hello from the Actor!');
14/**
15 * Actor code
16 */
17
18// Gracefully exit the Actor process. It's recommended to quit all Actors with an exit()
19await Actor.exit();

Empty JavaScript template

Start a new web scraping project quickly and easily in JavaScript (Node.js) with our empty project template. It provides a basic structure for building an Actor with Apify SDK and allows you to easily add your own functionality.

Included features

How it works

This template is useful when you're already familiar with the Apify SDK and Crawlee and want to start with a clean slate. It does not include puppeteer or playwright so install them manually and update the Dockerfile if you need them.

Resources

Already have a solution in mind?

Sign up for a free Apify account and deploy your code to the platform in just a few minutes! If you want a head start without coding it yourself, browse our Store of existing solutions.