Giter VIP home page Giter VIP logo

node-ini-parser's Introduction

Node ini-parser

Parse .ini files

Install

npm install ini-parser

Usage

var parser = require('ini-parser')

parse.parse(String)

parser.parseFile('path/to/file', function(error, data){
	// do something
})

parse.parseFileSync('path/to/file')

Example

var parser = require('ini-parser')

console.log( parser.parseFileSync('rythmbox.desktop') )

{
	"Desktop Entry": {
		"Name": "Rhythmbox",
		"GenericName": "Music Player",
		"X-GNOME-FullName": "Rhythmbox Music Player",
		"Comment": "Play and organize your music collection",
		"Exec": "rhythmbox %U",
		"Terminal": "false",
		"Type": "Application",
		"Icon": "rhythmbox",
		"X-GNOME-DocPath": "rhythmbox/rhythmbox.xml",
		"Categories": "GNOME;GTK;AudioVideo;",
		"MimeType": "application/x-ogg;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;audio/x-flac;",
		"Keywords": "Mp3;Audio;CD;MTP;Podcast;DAAP;Playlist;Ipod;",
		"StartupNotify": "true",
		"X-GNOME-Bugzilla-Bugzilla": "GNOME",
		"X-GNOME-Bugzilla-Product": "rhythmbox",
		"X-GNOME-Bugzilla-Component": "general",
		"X-GNOME-Bugzilla-OtherBinaries": "rhythmbox-client;rhythmbox-metadata;",
		"X-GNOME-Bugzilla-Version": "2.96",
		"Actions": "Play;Pause;Next;Previous;",
		"X-Ubuntu-Gettext-Domain": "rhythmbox"
	},
	
	"Desktop Action Play": {
		"Name": "Play",
		"Exec": "rhythmbox-client --play"
	},
	
	"Desktop Action Pause": {
		"Name": "Pause",
		"Exec": "rhythmbox-client --pause"
	},
	
	"Desktop Action Next": {
		"Name": "Next",
		"Exec": "rhythmbox-client --next"
	},
	
	"Desktop Action Previous": {
		"Name": "Previous",
		"Exec": "rhythmbox-client --previous"
	}
}

file rhythmbox.desktop
[Desktop Entry]
Name=Rhythmbox
GenericName=Music Player
X-GNOME-FullName=Rhythmbox Music Player
Comment=Play and organize your music collection
Exec=rhythmbox %U
Terminal=false
Type=Application
Icon=rhythmbox
X-GNOME-DocPath=rhythmbox/rhythmbox.xml
Categories=GNOME;GTK;AudioVideo;
MimeType=application/x-ogg;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;audio/x-flac;
Keywords=Mp3;Audio;CD;MTP;Podcast;DAAP;Playlist;Ipod;
StartupNotify=true
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=rhythmbox
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-OtherBinaries=rhythmbox-client;rhythmbox-metadata;
X-GNOME-Bugzilla-Version=2.96
Actions=Play;Pause;Next;Previous;
X-Ubuntu-Gettext-Domain=rhythmbox

[Desktop Action Play]
Name=Play
Exec=rhythmbox-client --play

[Desktop Action Pause]
Name=Pause
Exec=rhythmbox-client --pause

[Desktop Action Next]
Name=Next
Exec=rhythmbox-client --next

[Desktop Action Previous]
Name=Previous
Exec=rhythmbox-client --previous

node-ini-parser's People

Contributors

rawiroaisen avatar scd7896 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.