Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koffi

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koffi - npm Package Compare versions

Comparing version 2.3.13 to 2.3.14

build/2.3.14/koffi_darwin_arm64/koffi.node

7

CHANGELOG.md

@@ -7,2 +7,9 @@ # Changelog

#### Koffi 2.3.14
**Main changes:**
- Add `koffi.errno()` function to get and set current errno value
- Add `koffi.os.errno` object with valid errno codes
#### Koffi 2.3.13

@@ -9,0 +16,0 @@

@@ -104,1 +104,23 @@ # Miscellaneous

You can use `koffi.stats()` to get a few statistics related to Koffi.
## POSIX error codes
*New in Koffi 2.3.14*
You can use `koffi.errno()` to the current errno value, and `koffi.errno(value)` to change it.
The standard POSIX error codes are available in `koffi.os.errno`, as in the example below:
```js
const assert = require('assert');
const koffi = require('koffi');
const lib = koffi.load('libc.so.6');
const close = lib.func('int close(int fd)');
close(-1);
assert.equal(koffi.errno(), koffi.os.errno.EBADF);
console.log('close() with invalid FD is POSIX compliant!');
```

4

package.json
{
"name": "koffi",
"version": "2.3.13",
"stable": "2.3.13",
"version": "2.3.14",
"stable": "2.3.14",
"description": "Fast and simple C FFI (foreign function interface) for Node.js",

@@ -6,0 +6,0 @@ "keywords": [

@@ -134,4 +134,11 @@ // Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>

export let internal: Boolean;
export let extension: String;
export function errno(): number;
export function errno(value: number): number;
export const internal: Boolean;
export const extension: String;
export const os: {
errno: Record<string, number>
};
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc