Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

requirejs-config-file

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requirejs-config-file

A small api to read and write your requirejs config file

  • 3.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
725K
decreased by-18.9%
Maintainers
1
Weekly downloads
 
Created
Source

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();

Keywords

FAQs

Package last updated on 24 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc