New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-inline-content

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-inline-content - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

4

index.js

@@ -22,2 +22,6 @@ var fs = require('fs');

contentOptions = ('object' === typeof inlineContentForType) && inlineContentForType;
if (contentOptions && contentOptions.enabled !== undefined && Boolean(contentOptions.enabled) === false) {
return;
}

@@ -24,0 +28,0 @@ if (contentOptions && contentOptions.content) {

2

package.json
{
"name": "ember-cli-inline-content",
"version": "0.3.1",
"version": "0.3.2",
"description": "An ember-cli add-on to render inline scripts, styles, or any content directly into your index.html file",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -50,2 +50,3 @@ # ember-cli-inline-content [![Build Status](https://travis-ci.org/gdub22/ember-cli-inline-content.svg?branch=master)](https://travis-ci.org/gdub22/ember-cli-inline-content)

- content (String) Literal string content instead of loading a file
- enabled (Boolean) explicitly enable/disable inlining this content
- attrs (Object) Hash of html attributes to add to the generated tags

@@ -150,3 +151,16 @@ - postProcess (Function) Hook to perform any transformations on the loaded file contents

#### Explicitly enable/disable:
Brocfile.js:
```js
var app = new EmberApp({
inlineContent: {
'analytics' : {
file: './analytics.js',
enabled: process.env.EMBER_ENV === 'production'
}
}
});
```
## Why?

@@ -153,0 +167,0 @@ - You want some code to start executing before your whole app downloads

@@ -129,2 +129,23 @@ var InlineContentRenderer = require('../index.js');

equal( content, '<script>\n'+file+'console.log(1);'+'\n</script>' );
});
});
test('can explictly enable/disable via option', function() {
var renderer = new InlineContentRenderer(defaultProject);
var app = Object.create(defaultApp);
app.options.inlineContent = {
dummyJs: {
enabled: false,
file: './tests/dummy.js'
}
};
renderer.included(app);
var content = renderer.contentFor('dummyJs');
equal( content, undefined );
app.options.inlineContent.dummyJs.enabled = true;
renderer.included(app);
var content = renderer.contentFor('dummyJs');
var file = fs.readFileSync(path.join(renderer.project.root, app.options.inlineContent.dummyJs.file), 'utf8');
equal( content, '<script>\n'+file+'\n</script>' );
});
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