How can I get the path that the application is running with typescript?

geo

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 ?

Dan

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:

const remote = require('remote'), 
      app = remote.require('app');

var basepath = app.getAppPath();

Update - these days you should use:

const app = require('electron').remote.app

To get the app handle for app.getAppPath().

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I get the application path in C?

From Dev

How can I find a path to a running application on Mac OS X

From Java

How can I get the application's path in a .NET console application?

From Dev

How can I get drone.io running at a certain path?

From Dev

How can I get the external application data path in android?

From Dev

How to get the running path of a Symfony Console application?

From Dev

How can I hibernate a running application?

From Dev

How can I access the application manifest of the running application?

From Dev

How can I get the fqdn of a running TcpListener

From Dev

How can I get a history of running processes

From Dev

How can I get my HyperVisor running?

From Java

Swift: Can I get information for an application which is not running?

From Dev

How can I get the path of a module dynamically?

From Dev

How can I get the absolute path to the gulpfile?

From Dev

How can I get the proper capitalization for a path?

From Dev

How can I get the project path in Scala?

From Dev

How can I get the path of a module dynamically?

From Dev

How can I get the path of the previous url?

From Dev

How can I get PathSegment for the root @Path

From Dev

How can I get a reference to the main application MIDlet object when running Codename one application on Nokia s40 device?

From Dev

How can I specify a path relative to where my script is running?

From Dev

How can I know the absolute path of a running process?

From Dev

How can I specify the Jupyter notebook running path?

From Dev

How can I get Application in espresso?

From Dev

How can we get the command line of a running application?

From Dev

How can we get the command line of a running application?

From Dev

How can i know an application running in debug or run mode in eclipse

From Java

How can I debug my Quarkus application that is running in dev mode?

From Dev

How can I debug a running Kiosk-mode Chrome application?

Related Related

  1. 1

    How can I get the application path in C?

  2. 2

    How can I find a path to a running application on Mac OS X

  3. 3

    How can I get the application's path in a .NET console application?

  4. 4

    How can I get drone.io running at a certain path?

  5. 5

    How can I get the external application data path in android?

  6. 6

    How to get the running path of a Symfony Console application?

  7. 7

    How can I hibernate a running application?

  8. 8

    How can I access the application manifest of the running application?

  9. 9

    How can I get the fqdn of a running TcpListener

  10. 10

    How can I get a history of running processes

  11. 11

    How can I get my HyperVisor running?

  12. 12

    Swift: Can I get information for an application which is not running?

  13. 13

    How can I get the path of a module dynamically?

  14. 14

    How can I get the absolute path to the gulpfile?

  15. 15

    How can I get the proper capitalization for a path?

  16. 16

    How can I get the project path in Scala?

  17. 17

    How can I get the path of a module dynamically?

  18. 18

    How can I get the path of the previous url?

  19. 19

    How can I get PathSegment for the root @Path

  20. 20

    How can I get a reference to the main application MIDlet object when running Codename one application on Nokia s40 device?

  21. 21

    How can I specify a path relative to where my script is running?

  22. 22

    How can I know the absolute path of a running process?

  23. 23

    How can I specify the Jupyter notebook running path?

  24. 24

    How can I get Application in espresso?

  25. 25

    How can we get the command line of a running application?

  26. 26

    How can we get the command line of a running application?

  27. 27

    How can i know an application running in debug or run mode in eclipse

  28. 28

    How can I debug my Quarkus application that is running in dev mode?

  29. 29

    How can I debug a running Kiosk-mode Chrome application?

HotTag

Archive