Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ Bugfixes:

Other improvements:

## [v11.1.0](https://github.com/purescript-node/purescript-node-process/releases/tag/v11.1.0) - 2023-07-24

New Features:
- Add FFI for `getUid`/`getPid` (#43 by @JordanMartinez)

## [v11.0.1](https://github.com/purescript-node/purescript-node-process/releases/tag/v11.0.1) - 2023-07-21

Bugfixes:
- Fix FFI for `channelRef`/`channelUnref` (#40 by @JordanMartinez)
- Fix FFI for `channelRef`/`channelUnref` (#42 by @JordanMartinez)

## [v11.0.0](https://github.com/purescript-node/purescript-node-process/releases/tag/v11.0.0) - 2023-07-21

Expand Down
2 changes: 2 additions & 0 deletions src/Node/Process.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const setExitCodeImpl = (code) => {
process.exitCode = code;
};
export const getExitCodeImpl = () => process.exitCode;
export const getGidImpl = () => process.getgid();
export const getUidImpl = () => process.getuid();
export const hasUncaughtExceptionCaptureCallback = () => process.hasUncaughtExceptionCaptureCallback;
export const killImpl = (pid) => process.kill(pid);
export const killStrImpl = (pid, sig) => process.kill(pid, sig);
Expand Down
14 changes: 13 additions & 1 deletion src/Node/Process.purs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ module Node.Process
, exit'
, setExitCode
, getExitCode
, getGid
, getUid
, hasUncaughtExceptionCaptureCallback
, kill
, killStr
Expand Down Expand Up @@ -76,7 +78,7 @@ import Prelude

import Data.Maybe (Maybe)
import Data.Nullable (Nullable, toMaybe)
import Data.Posix (Pid)
import Data.Posix (Gid, Pid, Uid)
import Data.Posix.Signal (Signal)
import Data.Posix.Signal as Signal
import Data.String as String
Expand Down Expand Up @@ -384,6 +386,16 @@ getExitCode = map toMaybe getExitCodeImpl

foreign import getExitCodeImpl :: Effect (Nullable Int)

getGid :: Effect (Maybe Gid)
getGid = map toMaybe getGidImpl

foreign import getGidImpl :: Effect (Nullable Gid)

getUid :: Effect (Maybe Uid)
getUid = map toMaybe getUidImpl

foreign import getUidImpl :: Effect (Nullable Uid)

foreign import hasUncaughtExceptionCaptureCallback :: Effect (Boolean)

kill :: Pid -> Effect Unit
Expand Down