current_script 0.0.3 copy "current_script: ^0.0.3" to clipboard
current_script: ^0.0.3 copied to clipboard

Dart 1 only

Get current script name

currentScript #

This small one-function library allows to detect actual current script name in Dart.

It gets current stack trace (via stack_trace package) and gives you File object of last caller filename.

Example usage:

import 'package:current_script/current_script.dart';    
print(currentScript());
print(currentScript().parent); // will give you current file directory
0
likes
15
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Get current script name

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

path, stack_trace

More

Packages that depend on current_script