Skip to content

ehmpathy/as-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

as-command

test publish

Easily create commands within a pit of success

install

npm install as-command

use

for example

import { asCommand } from 'as-command';
import { getResourceNameFromFileName } from 'visualogic';
import { stage } from '../../../utils/environment';
import { log } from '../../../utils/logger';
import { COMMANDS_OUTPUT_DIRECTORY } from '../__tmp__/directory';

const command = asCommand(
  {
    name: getResourceNameFromFileName(__filename),
    stage: stage,
    dir: COMMANDS_OUTPUT_DIRECTORY,
    log,
  },
  async () => {
    // your logic
  }
);

// STAGE=test npx tsx src/contract/commands/yourLogic.ts
if (require.main === module) void command({});