Skip to content

nodejs process doesn't close after stopping #187

Open
@m0ppers

Description

@m0ppers
import nsfw from "nsfw";
import { setTimeout } from "timers/promises";

const main = async () => {
  const watcher = await nsfw(
    "/tmp",
    (events) => {
      console.log(events);
    },
    {
      errorCallback: (err) => {
        console.error(err);
      },
    }
  );
  await watcher.start();
  await setTimeout(10000);
  await watcher.stop();
};

main().then(() => {
  console.log("Done");
});

I am on linux and nodejs 22. Something seems to still be running as node won't automatically exit. Am I doing something wrong or is this a bug?

Done is being printed but then it hangs 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions