
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
refs-compiler
Advanced tools
Compiler for YAML, JSON and INI files using path references
# npm
# global
$ npm install -g refs-compiler
# dev dependency
$ npm install refs-compiler --save-dev
# Yarn
# global
$ yarn global add refs-compiler
# dev dependency
$ yarn add refs-compiler -D
AWSTemplateFormatVersion: '2010-09-09'
Resources:
- $ref: ./relative/path/to/file.yaml
RolePolicies:
$ref: ./resources/role-policies.yaml
Type: 'AWS::IAM::Policy'
Properties:
PolicyName: custom-role
Roles:
- custom-role
PolicyDocument:
Version: '2012-10-17'
Statement:
-
Sid: PassRole
Effect: Allow
Resource:
-
'Fn::Join':
- ""
-
- 'arn:aws:iam::'
-
Ref: 'AWS::AccountId'
- ':role/*'
Action:
- 'iam:PassRole'
// CommonJS
const path = require('path');
const { default: compiler } = require('refs-compiler');
// ES6
import path from 'path';
import compiler from 'refs-compiler';
const inputTemplate = path.resolve('/path/to/template.yaml');
const outputFile = path.resolve(`/path/to/output.yaml`);
try {
compiler(inputTemplate, outputFile)
.then(results => {
console.log(`file created in ${results.outputFile}`);
})
.catch(error => {
console.log(`An error occurred while writing the file: ${error.message}`);
console.log(error.stack);
});
} catch (e) {
console.error(e.message);
console.error(e.stack);
}
$ refs-compiler -o ./build/output.yaml ./templates/template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
- RolePolicies:
Type: 'AWS::IAM::Policy'
Properties:
PolicyName: custom-role
Roles:
- custom-role
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: PassRole
Effect: Allow
Resource:
- 'Fn::Join':
- ''
- - 'arn:aws:iam::'
- Ref: 'AWS::AccountId'
- ':role/*'
Action:
- 'iam:PassRole'
The base code was borrowed from doublenot/refs and then refactored / rewritten to support NodeJS 8+ using native Promises + async/await
FAQs
Compiler for YAML, JSON and INI files using path references
The npm package refs-compiler receives a total of 12 weekly downloads. As such, refs-compiler popularity was classified as not popular.
We found that refs-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.