Skip to content

Commit 27981bd

Browse files
committed
README was a bit buggy
1 parent 68fbb9d commit 27981bd

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1-
# dart tilde expansion
1+
# Tilde Expansion for Dart
2+
3+
A simple, efficient, and reusable Dart package to expand tilde (~) paths to the user's home directory.
24

3-
A String extension to expand the ~ in a path
45

56
since my proposition of a modification of the path project didn't find
67
favorable acknowledgment, this functionality being vital to most of my projects,
7-
her a miniature standalone library just for this....
8+
here a miniature standalone library just for this....
9+
10+
## Key Features:
811

9-
## usage
12+
Simple Usage: Easily expand tilde paths with a single method call.
13+
Works with ~/ and ~user paths, note that no verification of
14+
that user existence is done
15+
Cross-Platform Compatibility: Works seamlessly across different operating systems.
16+
Flexible Configuration: Customize expansion behavior with optional parameters.
17+
Efficient Implementation: Optimized for performance and clarity.
18+
19+
##Installation:
20+
```bash
21+
dart pub add tilde_expansion
1022
```
11-
import 'package:tilde_expansion/tilde_expansion.dart' as tilde_expansion;
1223

13-
void main(List<String> arguments) {
14-
print("Hello to convert ~/Documents/test.txt to ${'~/Documents/test.txt'.expandUser()}");
15-
}
24+
## Usage
25+
```
26+
import 'package:tilde_expansion/tilde_expansion.dart';
27+
28+
print("Expand path from ~/Documents/test.txt to ${'~/Documents/test.txt'.expandUser()}");
1629
```
1730

1831
or look at the tests, if no tilde is found nothing is done, you can actually ask to canonicalize the path
1932
by adding:
2033

2134
```
22-
import 'package:tilde_expansion/tilde_expansion.dart' as tilde_expansion;
35+
import 'package:tilde_expansion/tilde_expansion.dart';
2336
24-
void main(List<String> arguments) {
2537
print("Hello to convert ~/Documents/test.txt to ${'~/Documents/test.txt'.expandUser(canonicalize: true)}");
26-
}
38+
print("Hello to convert ~toto/Documents/test.txt to ${'~toto/Documents/test.txt'.expandUser(canonicalize: true)}");
2739
```
2840

41+
# Additional Notes:
42+
43+
Error Handling: The package handles cases where the HOME environment variable is not set.
44+
Performance: The implementation is optimized for efficiency, especially when dealing with large numbers of path expansions.
45+
46+
By using this package, you can simplify your code and make it more portable across different environments.

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- check if other user expansion is done, that that user exists....

0 commit comments

Comments
 (0)