I am trying to create a desktop application with electron, angular2, typescript and neDB.In order to be able create a 'file' database with neDB I want the path to my project.How can I get this with typescript ?
相关问题
- Angular RxJS mergeMap types
- void before promise syntax
- Ignore Typescript errors in Webpack-dev-server
- How can I get a window object from new BrowserWind
- Angular: ngc or tsc?
相关文章
- Cannot find module 'redux' 怎么解决?
- How to get a Component's own ElementRef for re
- 'Pick' only refers to a type, but is being
- Why does `keyof any` have type of `string | number
- React testing library: Test attribute / prop
- TypeScript - Puppeteer library error: “Cannot find
- How to reference type of self in Typescript interf
- React and typescript with webpack typing issue
Use app.getAppPath()
Typescript is a superset of javascript so you could do it in the same way you would do it with javascript, though you may want to declare typings, or use other typescript features when you do so.
Example:
Writing data to the application installation directory is generally a bad idea since the user running the app may not have permission to write files to that directory. What you should probably do instead is create the database file at the location returned by
app.getPath('userData')
.