avz / node-mkfifo Goto Github PK
View Code? Open in Web Editor NEWmkfifo(3) for NodeJS
License: MIT License
mkfifo(3) for NodeJS
License: MIT License
Add async version of the mkfifosync()
function.
Clone and npm i
:
npm WARN package.json [email protected] license should be a valid SPDX license expression
> [email protected] install /home/an/builds/node-mkfifo
> node-gyp rebuild
make: Entering directory '/home/an/builds/node-mkfifo/build'
CXX(target) Release/obj.target/mkfifo/src/mkfifo.o
../src/mkfifo.cpp: In function ‘void MkfifoSync(const v8::FunctionCallbackInfo<v8::Value>&)’:
../src/mkfifo.cpp:29:82: warning: ‘v8::Local<v8::Value> node::ErrnoException(int, const char*, const char*, const char*)’ is deprecated: Use UVException(isolate, ...) [-Wdeprecated-declarations]
NanThrowError(node::ErrnoException(errno, "mkfifo", strerror(errno), *pathAscii));
^
In file included from ../src/mkfifo.cpp:6:0:
/home/an/.node-gyp/2.3.0/src/node.h:100:45: note: declared here
inline v8::Local<v8::Value> ErrnoException(
^
/home/an/.node-gyp/2.3.0/src/node.h:66:42: note: in definition of macro ‘NODE_DEPRECATED’
__attribute__((deprecated(message))) declarator
^
SOLINK_MODULE(target) Release/obj.target/mkfifo.node
COPY Release/mkfifo.node
make: Leaving directory '/home/an/builds/node-mkfifo/build'
It's just a warning—it still installs fine. Just a heads-up.
When trying to install on node 0.12, the following errors are output, and installation fails.
> [email protected] install /Users/drew/temp/node_modules/mkfifo
> node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
CXX(target) Release/obj.target/mkfifo/src/mkfifo.o
../src/mkfifo.cpp:10:32: error: unknown type name 'Arguments'; did you mean
'v8::internal::Arguments'?
Handle<Value> MkfifoSync(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note:
'v8::internal::Arguments' declared here
class Arguments;
^
../src/mkfifo.cpp:11:14: error: calling a protected constructor of class
'v8::HandleScope'
HandleScope scope;
^
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: note: declared
protected here
V8_INLINE HandleScope() {}
^
../src/mkfifo.cpp:13:10: error: member access into incomplete type 'const
v8::internal::Arguments'
if (args.Length() < 2) {
^
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: forward
declaration of 'v8::internal::Arguments'
class Arguments;
^
../src/mkfifo.cpp:14:47: error: no member named 'New' in 'v8::String'
ThrowException(Exception::TypeError(String::New("Wrong n...
~~~~~~~~^
../src/mkfifo.cpp:15:16: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(Undefined());
~~~~~ ^
../src/mkfifo.cpp:15:22: error: no matching function for call to 'Undefined'
return scope.Close(Undefined());
^~~~~~~~~
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate
function not viable: requires single argument 'isolate', but no arguments
were provided
friend Handle<Primitive> Undefined(Isolate* isolate);
^
../src/mkfifo.cpp:18:11: error: type 'const v8::internal::Arguments' does not
provide a subscript operator
if (!args[0]->IsString() || !args[1]->IsNumber()) {
~~~~^~
../src/mkfifo.cpp:18:35: error: type 'const v8::internal::Arguments' does not
provide a subscript operator
if (!args[0]->IsString() || !args[1]->IsNumber()) {
~~~~^~
../src/mkfifo.cpp:19:47: error: no member named 'New' in 'v8::String'
ThrowException(Exception::TypeError(String::New("Wrong a...
~~~~~~~~^
../src/mkfifo.cpp:20:16: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(Undefined());
~~~~~ ^
../src/mkfifo.cpp:20:22: error: no matching function for call to 'Undefined'
return scope.Close(Undefined());
^~~~~~~~~
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate
function not viable: requires single argument 'isolate', but no arguments
were provided
friend Handle<Primitive> Undefined(Isolate* isolate);
^
../src/mkfifo.cpp:24:28: error: type 'const v8::internal::Arguments' does not
provide a subscript operator
mode_t mode = (mode_t)args[1]->Uint32Value();
~~~~^~
../src/mkfifo.cpp:25:10: error: no member named 'AsciiValue' in 'v8::String'
String::AsciiValue pathAscii(args[0]);
~~~~~~~~^
../src/mkfifo.cpp:27:13: error: use of undeclared identifier 'pathAscii'
if(mkfifo(*pathAscii, mode) != 0) {
^
../src/mkfifo.cpp:28:74: error: use of undeclared identifier 'pathAscii'
..."mkfifo", strerror(errno), *pathAscii));
^
../src/mkfifo.cpp:30:16: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(Undefined());
~~~~~ ^
../src/mkfifo.cpp:30:22: error: no matching function for call to 'Undefined'
return scope.Close(Undefined());
^~~~~~~~~
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate
function not viable: requires single argument 'isolate', but no arguments
were provided
friend Handle<Primitive> Undefined(Isolate* isolate);
^
../src/mkfifo.cpp:33:15: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(Undefined());
~~~~~ ^
../src/mkfifo.cpp:33:21: error: no matching function for call to 'Undefined'
return scope.Close(Undefined());
^~~~~~~~~
/Users/drew/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate
function not viable: requires single argument 'isolate', but no arguments
were provided
friend Handle<Primitive> Undefined(Isolate* isolate);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Unable to install on Node 11
/root/.node-gyp/11.0.0/include/node/v8.h:2571:47: note: declared here V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const); ^ /root/.node-gyp/11.0.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’ declarator __attribute__((deprecated(message))) ^~~~~~~~~~ mkfifo.target.mk:101: recipe for target 'Release/obj.target/mkfifo/src/mkfifo.o' failed make: *** [Release/obj.target/mkfifo/src/mkfifo.o] Error 1 make: Leaving directory '/root/node_modules/mkfifo/build' gyp ERR! build error gyp ERR! stack Error:
make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12) gyp ERR! System Linux 4.15.0-34-generic gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /root//node_modules/mkfifo gyp ERR! node -v v11.0.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok
hi! thnks for the great module, i was looking for something like this.
is it possible to support windows? to create a named pipe on windows?
When trying to install mkfifo
with Node.js 6.0.0-pre there are some errors related to v8. You should update the code to use nan
module to make it agnostic to the Node.js version being used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.