/dom-automator

Package for analyzing and automating actions on a DOM

Primary LanguageTypeScriptMIT LicenseMIT

dom-automator

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Package for analyzing and automating actions on a DOM

Install

npm install dom-automator

Usage

import { createAgent, createActionScript } from 'dom-automator'

const getCurrentDOM = async (): string => {
  return '<html></html>'
}

const agent = await createAgent('Send an email to Todd that I cant make the meeting today', getCurrentDOM)

// agent.actions() is an AsyncGenerator
for await (const act of agent.actions()) {
    console.log('Executing:', act)
    const js = createActionScript(act)
    // Act it out here
}