Comments (2)
Platform.script.path
is the Dart idiom for __filename
from node. You can use normalize
and dirname
(as you have demonstrated here) to manipulate it.
It would not be possible for us to add a member named __filename
since that would be private in Dart. We also don't want to add something that relies on Platform
in this package since it would not be compatible with running on the web. I think the solution you'd pasted here is what I'd run with - though with perhaps avoiding a manual replaceFirst
of the /
...
from path.
Platform.script.toFilePath()
is better.
from path.
Related Issues (20)
- package website unreachable HOT 1
- Windows paths shouldn't be canonicalized to lower-case HOT 2
- Exception: NoSuchMethodError: The method 'pathFromUri' was called on null. HOT 4
- Support \\?\ prefix in UNC Windows paths HOT 2
- [Question] Is it possible to enforce style or context? HOT 1
- please support package's protocol path HOT 1
- setExtension removes part of a filename if it contained dot
- setExtension removes part of a filename if it contained dot HOT 1
- flutter_test from sdk depends on path 1.8.0 HOT 8
- `isWithin` has surprising behavior when `base` ends with `/.` and `child` starts with `.` HOT 1
- does not parse ~ HOT 1
- Version 1.8.1. `path.posix` has many bugs. HOT 1
- Error by installing path 1.8.1 HOT 1
- version solving failed HOT 1
- Why does .dirname(String) return '.' instead of '' when passed an empty (non-null) string HOT 1
- Getting `version solving failed` with using 1.8.3 version HOT 1
- isAbsolute(r'\') should return false for Windows-style filesystem HOT 4
- pathContext.fromUri() mishandles encoded colons after drive letters HOT 4
- join() not working as advertised
- Can the latest version be compatible with the latest stable version of Flutter? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from path.