Node-GIR คือ Node.js การเชื่อมโยงไปยังการวิปัสสนาของ GoBject ทำให้สามารถโทรอัตโนมัติและไดนามิกไปยังไลบรารีใด ๆ ที่ติดตั้งคำอธิบายประกอบ GI ซึ่งรวมถึงห้องสมุดส่วนใหญ่จากโครงการ GNOME
สิ่งนี้จะทำให้เป็นไปได้ที่จะสคริปต์ระบบเดสก์ท็อป GNOME ทั้งหมดจากโหนดมากในแบบที่ทำในวันนี้ด้วยเมล็ด GJs หรือ Pygtk นอกจากนี้ยังอนุญาตให้ใช้ไลบรารี GNOME ในแอปพลิเคชัน Node.js ด้วยมันคุณยังสามารถเขียนส่วนที่เน้นประสิทธิภาพของแอปพลิเคชันของคุณใน Vala และโทรหาพวกเขาจาก node.js และภาษาอื่น ๆ
คุณต้องติดตั้งไลบรารีการวิปัสสนา Gobject ในระบบที่มีลักษณะคล้าย Debian สิ่งนี้จะได้รับการจัดการโดย:
$ sudo apt-get install libgirepository1.0-dev
จากนั้นเพียงแค่สร้างโหนด GIR ด้วย:
$ npm install gir
The node-gir repository comes with a set of tests that utilize the Midgard2 library to test against. You need also that installed, and then run:
$ npm test
Travis is used for Continous Integration:
The following graph shows all the parts and how they work together. The only missing part is node bindings to libgirepository. ดังนั้นโครงการนี้
BUILD TIME:
+-----------------------------------------------------------+
| foo.c |
| foo.h |
| |
| Library sources, with type annotations |
+-----------------------------------------------------------+
| |
gcc g-ir-scanner
| |
| V
| +------------------------+
| | Foo.gir |
| | |
| | <GI-name>.gir |
| | |
| | XML file |
| | |
| | Invocation information |
| | Required .gir files |
| | API docs |
| | |
| +------------------------+
| |
| g-ir-compiler
| |
DEPLOYMENT TIME: |
| |
V V
+-----------------------------+ +---------------------------+
| libfoo.so | | Foo.typelib |
| | | |
| | | Binary version of the |
| ELF file | | invocation info and |
| | | required .typelib files |
| Machine code, plus | +---------------------------+
| dynamic linkage information | A
| (DWARF debug data, etc) | |
+-----------------------------+ |
A |
| +---------------------------+
| | libgirepository.so |
+-----------+ | |
| libffi.so | | Can read typelibs and |
| | | present them in a |
+-----------+ | libffi-based way |
A | |
| +---------------------------+
| A
| |
| +------------+
+--------------------------| node-gir |
| |
+--------->+------------+
|
+------------------+
| NodeJS |
+------------------+
เพราะพวกเขาดี แต่ไม่ใช่สิ่งที่ฉันกำลังมองหา โหนดเป็นที่นิยมมากและมันก็ดีที่จะสามารถใช้งานได้สำหรับเครื่องมือและแอพพลิเคชั่นเดสก์ท็อป
นี่คือลิงค์และบันทึกย่อบางส่วนในขณะที่ฉันพยายามหาวิธีทำสิ่งนี้
ความคิดเหล่านี้บางอย่างจะไปในการผูกมัดนี้และบางอย่างจะไปใน wrappers ที่ดีที่ใช้มัน ฉันจะรู้มากขึ้นเมื่อเราก้าวหน้า
camelCase
สำหรับวิธีการที่ถูกผูกไว้กับ JavaScripty.on(name, callback)
เพื่อแนบสัญญาณ