nar: node.js application archive

359 views
Skip to first unread message

Tomas Aparicio

unread,
Apr 17, 2014, 2:02:46 PM4/17/14
to nod...@googlegroups.com
Hi everyone!

I just released nar, a simple utility for creating self-contained node applications that are ready to ship and run
It was created especially for deployments into isolated servers

I think it could be useful to the node community in general

Note that nar is still beta. Feedback, issues and PR are really appreciated


Thanks for reading!

Alex Kocharin

unread,
Apr 17, 2014, 3:08:49 PM4/17/14
to nod...@googlegroups.com
 
Isn't it something nexe is doing already?
 
 
17.04.2014, 22:02, "Tomas Aparicio" <to...@aparicio.me>:
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Ingwersen

unread,
Apr 17, 2014, 3:09:50 PM4/17/14
to nod...@googlegroups.com
No. Nexe builds executables, whilst nar is like jar or phar (java archive, php archive).
I like the project, very nice. :3
--



Alex Kocharin

unread,
Apr 17, 2014, 3:14:15 PM4/17/14
to nod...@googlegroups.com
 
browserify then? :)
 
 
17.04.2014, 23:09, "Kevin Ingwersen" <ingwi...@googlemail.com>:

Tomás Aparicio

unread,
Apr 17, 2014, 4:09:46 PM4/17/14
to nod...@googlegroups.com
Thanks for the replies

Kevin, you're right. nar was inspired in jar, but focusing in node-specific particularities and features, however, it has no relationship with Browserify. It's similar to nexe, but execution of the .nar archive is just optional

Just think about an utility to create self-contained applications with optionally a runtime isolated environment with node binary and global packages

El 17/04/14 21:14, Alex Kocharin escribió:
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/0_C1hcAbUyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.

Tomás Aparicio

unread,
Apr 18, 2014, 6:00:06 PM4/18/14
to nod...@googlegroups.com
I just released both Grunt and Gulp plugins for creating and extracting nar archives.

I hope both could be useful:
https://github.com/h2non/grunt-nar
https://github.com/h2non/gulp-nar


El 17/04/14 21:14, Alex Kocharin escribió:
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/0_C1hcAbUyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.

Tomás Aparicio

unread,
May 10, 2014, 4:36:04 PM5/10/14
to nod...@googlegroups.com
FYI

nar 0.2.0 is out with useful new features.
Now you can download, install and run archives from remote servers

Some CLI usage examples:

$ nar run http://server.net/app-0.1.0.nar
$ nar install http://server.net/app-0.1.0.nar --save
$ nar get http://server.net/app-0.1.0.nar

More info: https://github.com/h2non/nar

El 17/04/14 20:02, Tomas Aparicio escribió:

Tomás Aparicio

unread,
Jun 29, 2014, 12:06:58 PM6/29/14
to nod...@googlegroups.com
Some users asked me about a way to create fully self-contained nar archives that do not requires that node or nar must be already installed in the system in order to run or extract an application

I've finally decided to provide support to this feature. From 0.3.0 version you can create executable binary-like nar archives that do not have external dependencies. node binary and nar package are now embedded

$ nar create --executable
> It generates server-0.1.0.nar, for example

Then you can distribute your archive into a fresh server (without node installed) and simply run
$ chmod +x server-0.1.0.nar
$ ./server-0.1.0.nar run --args-start='--port 8080'

$ npm install -g nar

I hope this will be useful

Ah! I just want to mark that nar was created to be an application container to distribute, run and install private node applications that are outside of the npm ecosystem

El 10/05/14 22:36, Tomás Aparicio escribió:

Ryan Schmidt

unread,
Jul 2, 2014, 5:52:57 PM7/2/14
to nod...@googlegroups.com

On Jun 29, 2014, at 6:45 AM, Tomás Aparicio wrote:

> Some users asked me about a way to create fully self-contained nar archives that do not requires that node or nar must be already installed in the system in order to run or extract an application
>
> I've finally decided to provide support to this feature. From 0.3.0 version you can create executable binary-like nar archives that do not have external dependencies. node binary and nar package are now embedded
>
> $ nar create --executable
> > It generates server-0.1.0.nar, for example
>
> Then you can distribute your archive into a fresh server (without node installed) and simply run
> $ chmod +x server-0.1.0.nar
> $ ./server-0.1.0.nar run --args-start='--port 8080'
>
> $ npm install -g nar
>
> I hope this will be useful

Presumably this executable is only usable on a single platform/OS/architecture? Is that the same platform/OS/architecture on which it was created? For example, executable archives made on 64-bit Intel Mac OS X can only be run on 64-bit Intel Mac OS X, and executable archives created on 32-bit Intel Gentoo Linux can only be run on 32-bit Intel Gentoo Linux?

Ingwie Phoenix

unread,
Jul 2, 2014, 5:59:51 PM7/2/14
to nod...@googlegroups.com
Very surely. At least the embedded nodejs is.

From what I can see, this sounds like the good old „shar“. It was a way to archieve files into a shell script, and then extract them from themselves. Maybe I am getting soemthing wrong, but it was similar for sure.

You can, however, create an automation. Lets say, a tool like node-gyp, just for nar:

$ nar-maker ./myfolder
— Created: server-0.3.0-win32.nar
— Created: server-0.3.0-linux64.nar
— Created: server-0.3.0-linux32.nar
— Created: server-0.3.0-macosx64.nar

How this would work? The tool would’ve been downloading the different nodejs executables - note, only the executables - and just packaged the nar archives with the correct binary.

That, would at least solve this little issue. You can’t make one package for all systems, sadly. Windows, Linux and Mac use far too different binary file layouts…just look at developers ranting about dynamic libraries for windows, where you have to add an extra macro across the whole of your project, just ot export the functions. XD

Tomas Aparicio

unread,
Jul 2, 2014, 7:59:15 PM7/2/14
to nod...@googlegroups.com
Hi Ryan!

Yes, I had it in mind-roadmap
I've released a new version (0.3.2) that adds support for creating executables with a custom platform/arch/node version

For example, under OSX you could use:
$ nar create --executable --os linux --arch x64 --node 0.11.9

It's available from npm:
$ npm update -g nar

I need to test it in Windows! :S



---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/0_C1hcAbUyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/9C296EB6-CC61-4A71-A6EE-A5F34FD5B9A9%40ryandesign.com.

For more options, visit https://groups.google.com/d/optout.



--
Tomás Aparicio

Tomas Aparicio

unread,
Jul 2, 2014, 7:59:15 PM7/2/14
to nod...@googlegroups.com
You can automate it from node using the grunt and gulp plugins
I'll update both plugins to support executable creation mode


2014-07-02 23:58 GMT+02:00 Ingwie Phoenix <ingwi...@googlemail.com>:

Am 02.07.2014 um 20:31 schrieb Ryan Schmidt <googl...@ryandesign.com>:

>
> On Jun 29, 2014, at 6:45 AM, Tomás Aparicio wrote:
>
>> Some users asked me about a way to create fully self-contained nar archives that do not requires that node or nar must be already installed in the system in order to run or extract an application
>>
>> I've finally decided to provide support to this feature. From 0.3.0 version you can create executable binary-like nar archives that do not have external dependencies. node binary and nar package are now embedded
>>
>> $ nar create --executable
>>> It generates server-0.1.0.nar, for example
>>
>> Then you can distribute your archive into a fresh server (without node installed) and simply run
>> $ chmod +x server-0.1.0.nar
>> $ ./server-0.1.0.nar run --args-start='--port 8080'
>>
>> $ npm install -g nar
>>
>> I hope this will be useful
>
> Presumably this executable is only usable on a single platform/OS/architecture? Is that the same platform/OS/architecture on which it was created? For example, executable archives made on 64-bit Intel Mac OS X can only be run on 64-bit Intel Mac OS X, and executable archives created on 32-bit Intel Gentoo Linux can only be run on 32-bit Intel Gentoo Linux?
Very surely. At least the embedded nodejs is.

From what I can see, this sounds like the good old "shar". It was a way to archieve files into a shell script, and then extract them from themselves. Maybe I am getting soemthing wrong, but it was similar for sure.

You can, however, create an automation. Lets say, a tool like node-gyp, just for nar:

$ nar-maker ./myfolder
-- Created: server-0.3.0-win32.nar
-- Created: server-0.3.0-linux64.nar
-- Created: server-0.3.0-linux32.nar
-- Created: server-0.3.0-macosx64.nar


How this would work? The tool would've been downloading the different nodejs executables - note, only the executables - and just packaged the nar archives with the correct binary.

That, would at least solve this little issue. You can't make one package for all systems, sadly. Windows, Linux and Mac use far too different binary file layouts...just look at developers ranting about dynamic libraries for windows, where you have to add an extra macro across the whole of your project, just ot export the functions. XD
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/0_C1hcAbUyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Tomás Aparicio

Tomás Aparicio

unread,
Jul 3, 2014, 5:11:52 AM7/3/14
to nod...@googlegroups.com
Just to announce that nar had an issue in Windows and it was fixed in 0.3.5 version
I've tested it in Windows 7 generating different executables for OSX and Linux

Anyway, if you experiment any issue, please report it via Github


$ npm update -g nar

El 02/07/14 23:58, Ingwie Phoenix escribió:
Am 02.07.2014 um 20:31 schrieb Ryan Schmidt <googl...@ryandesign.com>:

On Jun 29, 2014, at 6:45 AM, Tomás Aparicio wrote:

Some users asked me about a way to create fully self-contained nar archives that do not requires that node or nar must be already installed in the system in order to run or extract an application

I've finally decided to provide support to this feature. From 0.3.0 version you can create executable binary-like nar archives that do not have external dependencies. node binary and nar package are now embedded

$ nar create --executable 
It generates server-0.1.0.nar, for example
Then you can distribute your archive into a fresh server (without node installed) and simply run
$ chmod +x server-0.1.0.nar
$ ./server-0.1.0.nar run --args-start='--port 8080'

$ npm install -g nar

I hope this will be useful
Presumably this executable is only usable on a single platform/OS/architecture? Is that the same platform/OS/architecture on which it was created? For example, executable archives made on 64-bit Intel Mac OS X can only be run on 64-bit Intel Mac OS X, and executable archives created on 32-bit Intel Gentoo Linux can only be run on 32-bit Intel Gentoo Linux?
Very surely. At least the embedded nodejs is.

From what I can see, this sounds like the good old "shar". It was a way to archieve files into a shell script, and then extract them from themselves. Maybe I am getting soemthing wrong, but it was similar for sure.

You can, however, create an automation. Lets say, a tool like node-gyp, just for nar:

$ nar-maker ./myfolder
-- Created: server-0.3.0-win32.nar
-- Created: server-0.3.0-linux64.nar
-- Created: server-0.3.0-linux32.nar
-- Created: server-0.3.0-macosx64.nar

How this would work? The tool would've been downloading the different nodejs executables - note, only the executables - and just packaged the nar archives with the correct binary.

That, would at least solve this little issue. You can't make one package for all systems, sadly. Windows, Linux and Mac use far too different binary file layouts...just look at developers ranting about dynamic libraries for windows, where you have to add an extra macro across the whole of your project, just ot export the functions. XD


Tomás Aparicio

unread,
Jul 3, 2014, 5:11:53 AM7/3/14
to nod...@googlegroups.com
Just to announce that nar had an issue in Windows and it was fixed in 0.3.5 version
I've tested it in Windows 7 generating different executables for OSX and Linux

Anyway, if you experiment any issue, please report it via Github

El 02/07/14 23:58, Ingwie Phoenix escribió:
Am 02.07.2014 um 20:31 schrieb Ryan Schmidt <googl...@ryandesign.com>:

On Jun 29, 2014, at 6:45 AM, Tomás Aparicio wrote:

Some users asked me about a way to create fully self-contained nar archives that do not requires that node or nar must be already installed in the system in order to run or extract an application

I've finally decided to provide support to this feature. From 0.3.0 version you can create executable binary-like nar archives that do not have external dependencies. node binary and nar package are now embedded

$ nar create --executable 
It generates server-0.1.0.nar, for example
Then you can distribute your archive into a fresh server (without node installed) and simply run
$ chmod +x server-0.1.0.nar
$ ./server-0.1.0.nar run --args-start='--port 8080'

$ npm install -g nar

I hope this will be useful
Presumably this executable is only usable on a single platform/OS/architecture? Is that the same platform/OS/architecture on which it was created? For example, executable archives made on 64-bit Intel Mac OS X can only be run on 64-bit Intel Mac OS X, and executable archives created on 32-bit Intel Gentoo Linux can only be run on 32-bit Intel Gentoo Linux?
Very surely. At least the embedded nodejs is.

From what I can see, this sounds like the good old "shar". It was a way to archieve files into a shell script, and then extract them from themselves. Maybe I am getting soemthing wrong, but it was similar for sure.

You can, however, create an automation. Lets say, a tool like node-gyp, just for nar:

$ nar-maker ./myfolder
-- Created: server-0.3.0-win32.nar
-- Created: server-0.3.0-linux64.nar
-- Created: server-0.3.0-linux32.nar
-- Created: server-0.3.0-macosx64.nar

How this would work? The tool would've been downloading the different nodejs executables - note, only the executables - and just packaged the nar archives with the correct binary.

That, would at least solve this little issue. You can't make one package for all systems, sadly. Windows, Linux and Mac use far too different binary file layouts...just look at developers ranting about dynamic libraries for windows, where you have to add an extra macro across the whole of your project, just ot export the functions. XD


Reply all
Reply to author
Forward
0 new messages