requirejs-config-file
A small api to read and write your requirejs config file
Last updated 5 years ago by pscheit .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install requirejs-config-file 
SYNC missed versions from official npm registry.

requirejs-config-file Build Status

NPM

A small api to read and write your requirejs config file

installation

npm install requirejs-config-file

usage

require the constructor

var ConfigFile = require('requirejs-config-file').ConfigFile;

read

// Read: reading the config
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));

var config = configFile.read();

console.log(config); // is an object with the found config

modify (read and write)

// Modify: reading and writing the config
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));

var config = configFile.read();

config.baseUrl = '/new';

configFile.write();

create

// CreateExample: creating a new config file
var configFile = new ConfigFile('path/to/new-config.js'));

configFile.createIfNotExists();

configFile.write();

create or modify

// CreateAndModifyExample: reading and writing a maybe not existing config file
var configFile = new ConfigFile('path/to/new-config.js'));

configFile.createIfNotExists();

configFile.read();

config.baseUrl = '/new';

configFile.write();

Current Tags

  • 4.0.0                                ...           latest (5 years ago)

16 Versions

  • 4.0.0                                ...           5 years ago
  • 3.1.2                                ...           7 years ago
  • 3.1.1                                ...           7 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           12 years ago
  • 1.2.2                                ...           12 years ago
  • 1.2.1                                ...           13 years ago
  • 1.2.0                                ...           13 years ago
  • 1.1.1                                ...           13 years ago
  • 1.1.0                                ...           13 years ago
  • 1.0.5                                ...           13 years ago
  • 1.0.4                                ...           13 years ago
  • 1.0.3                                ...           13 years ago
  • 1.0.2                                ...           13 years ago
  • 1.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 16
Last Day 0
Last Week 16
Last Month 1
Dependencies (2)
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |