filetools 1.0.6 copy "filetools: ^1.0.6" to clipboard
filetools: ^1.0.6 copied to clipboard

FileTools: cross-platform glob & streams.

example/example.md

ft (FileTools) employs a three-stage processing architecture. This modular design, through a clear separation of concerns, provides excellent maintainability, extensibility, and ease of use, facilitating rapid developer integration and feature customization.

This architecture includes:

  1. Input Preparation: Environment and parameter setup.
  2. Core Logic Execution: Invoking encapsulated modules.
  3. Output Post-processing (Optional): For feature extension and result customization.

See the Common API Manual for a full list of available APIs.

// ft_example.dart

import 'package:filetools/ft.dart';

void main() {
  // print('os:$ftOs');

  actionList();
  // actionSearch();
}

// matches all files in the current directory, excluding hidden items
void actionList() {
  // step 1: input preparation stage
  final action = BasicPathAction(r'.', excludes: [r'.**']);

  // step 2: core processing stage
  action.list();
}

// matches yaml files in the current directory, excluding hidden items
// search `version: 1.0.\d+`
void actionSearch() {
  // step 1: input preparation stage
  final pattern = r'**.yaml';
  final excludes = [r'.**'];
  final source = '.';
  final action = BasicPathAction(source, pattern: pattern, excludes: excludes);

  // step 2: core processing stage
  final regexp = r'version: 1.0.\d+';
  try {
    action.search(regexp);
  } on ArgumentError catch (e) {
    print(e);
  } catch (e) {
    print(e);
  }

  // ufn_lastline
}

1
likes
150
points
211
downloads
screenshot

Documentation

API reference

Publisher

verified publisheriche2.com

Weekly Downloads

FileTools: cross-platform glob & streams.

Repository (GitHub)
View/report issues

Topics

#cli #files #tools #utils #command

Funding

Consider supporting this project:

github.com

License

LGPL-2.1 (license)

Dependencies

args, cli_config, cli_util, glob, mime, path, tar

More

Packages that depend on filetools