dfn 0.2.2 copy "dfn: ^0.2.2" to clipboard
dfn: ^0.2.2 copied to clipboard

Use Dart as your scripting language, and register scripts from anywhere.

dfn: Dart as Functions + Scripting #

Install via:

  • pub.dev: dart pub global activate dfn
  • local development: dart pub global activate -spath .
  • git repo: dart pub global activate -sgit https://github.com/Luckey-Elijah/dfn.git

Usage #

Overview:

dfn <command> description
dfn core tool
dfn <script> run a registered script
dfn <args> forward args to dart run (tries scripts first)
dfn config for managing scripts (see add/rm)
dfn config add <script/path> for registering scripts
dfn config remove <script/path> for un-registering scripts (alias dfn config rm)
dfn list for showing all registered scripts (alias dfn ls)

Example: #

  1. Register script(s):
$ dfn config add example # via "package" with a "scripts" directory
Registered 1 new script from /path/to/example/scripts
  - hello_from_folder -> /path/to/example/scripts/hello_from_folder.dart

$ dfn config add example/hello_from_standalone.dart 
Registered hello_from_standalone
  1. List all scripts:
$ dfn list
✓ 2 scripts available:
  - hello_from_standalone -> /path/to/example/hello_from_standalone.dart
  - hello_from_folder -> /path/to/example/scripts
  1. Run the scripts:
$ dfn hello_from_standalone
Hello from standalone file!

$ dfn hello_from_folder
Hello from script folder!
  1. Remove the scripts:
$ dfn config rm hello_from_standalone # rm or remove are both valid
Removed: /path/to/example/hello_from_standalone.dart

$ dfn config remove example # need to pass the directory for "packages"
Removed: /path/to/example
  1. Forward args to dart run:
$ dfn test:test test/some_test.dart
0
likes
130
pub points
0%
popularity

Publisher

verified publisherelijahluckey.com

Use Dart as your scripting language, and register scripts from anywhere.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

http, mason_logger, path, pub_semver

More

Packages that depend on dfn