Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions templates/ts-empty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

<!-- This is an Apify template readme -->

Start a new [web scraping](https://apify.com/web-scraping) project quickly and easily in TypeScript (Node.js) with our empty project template. It provides a basic structure for the Actor with [Apify SDK](https://docs.apify.com/sdk/js/) and allows you to easily add your own functionality.
Start a new Apify Actor project in TypeScript (Node.js) with only the [Apify SDK](https://docs.apify.com/sdk/js/) preinstalled. Add whatever dependencies and functionality your Actor needs.

## Included features

- **[Apify SDK](https://docs.apify.com/sdk/js/)** - a toolkit for building [Actors](https://apify.com/actors)
- **[Crawlee](https://crawlee.dev/)** - web scraping and browser automation library

## How it works

Insert your own code between `await Actor.init()` and `await Actor.exit()`. If you would like to use the [Crawlee](https://crawlee.dev/) library simply uncomment its import `import { CheerioCrawler } from '@crawlee/cheerio';`.
Insert your own code between `await Actor.init()` and `await Actor.exit()`. Install additional dependencies as needed.

If you want to build a web scraper on top of [Crawlee](https://crawlee.dev/), start from the **Crawlee + Cheerio** template instead — it comes preconfigured with `@crawlee/cheerio` and an example crawler.

## Resources

Expand Down
3 changes: 1 addition & 2 deletions templates/ts-empty/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"apify": "^3.7.0",
"@crawlee/cheerio": "^3.15.3"
"apify": "^3.7.0"
},
"devDependencies": {
"@apify/eslint-config": "^2.0.0",
Expand Down
7 changes: 0 additions & 7 deletions templates/ts-empty/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
// Apify SDK - toolkit for building Apify Actors (Read more at https://docs.apify.com/sdk/js/)
import { Actor, log } from 'apify';
// Crawlee - web scraping and browser automation library (Read more at https://crawlee.dev)
// import { CheerioCrawler } from '@crawlee/cheerio';

// this is ESM project, and as such, it requires you to specify extensions in your relative imports
// read more about this here: https://nodejs.org/docs/latest-v18.x/api/esm.html#mandatory-file-extensions
// note that we need to use `.js` even when inside TS files
// import { router } from './routes.js';

// The init() call configures the Actor to correctly work with the Apify-provided environment - mainly the storage infrastructure. It is necessary that every Actor performs an init() call.
await Actor.init();
Expand Down
Loading