Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
simple-boot-front
Advanced tools
Our primary goals are
npm init simple-boot-front projectname
cd projectname
npm start
# open browser: http://localhost:4500
┌─ assets
├─ dist (out put directory)
├─ src (source)
│ ├─ pages (your pages)
│ │ ├ home.ts (sample page)
│ │ └ user.ts (sample page)
│ ├─ index.css (index route page css)
│ ├─ index.html (index route page template)
│ └─ index.ts (simple-boot-fornt start and route point)
├─ types (typescript type)
│ └ index.d.ts (type definition)
├─ index.html start (point html)
├─ package.json (project config)
├─ rollup.config.js (rollup bundler config)
└─ tsconfig.json (typescript config)
@Sim()
@Component({
template: '<div>home</div>'
})
export class Home {
}
@Sim()
@Component({
template: '<div>user</div>'
})
export class User {
}
<header>
<nav>
<ul>
<li>
<button router-link="/">home</button>
</li>
<li>
<button router-link="/user">user</button>
</li>
</ul>
</nav>
</header>
<main>
<router component="this.child"></router>
</main>
<footer>
footer
</footer>
header, footer, main {
border: #333333 1px solid;
padding: 20px;
margin: 20px;
}
index.ts ▼
import template from './index.html'
import style from './index.css'
@Sim()
@Router({
path: '',
route: {
'/': Home,
'/user': User
}
})
@Component({
template,
styles: [style]
})
export class Index implements RouterAction {
child?: any;
async canActivate(url: any, module: any) {
this.child = module;
}
}
const config = new SimFrontOption(window).setUrlType(UrlType.hash);
const simpleApplication = new SimpleBootFront(Index, config);
simpleApplication.run();
Objects managed by the SimpleBootFront framework
@Sim({scheme: 'index'})
<!--template.html-->
<h1>${this.title}</h1>
<div>#innerHTML#</div>
import template from './index.html'
import style from './index.css'
@Sim()
@Component({
selector: 'index', // default class name LowerCase
template,
styles: [style]
})
export class Index {
public title = ''
public setData(title: string) {
this.title = title;
}
}
constructor(index: Index){...}
<index></index>
<!-- dr-set: $index.setData('data'); $element, $innerHTML, $attributes -->
<index dr-set="$index.setData('hello component')">
<ul>
<li>content</li>
</ul>
</index>
import template from './index.html'
import style from './index.css'
@Sim()
@Router({
path: '',
route: {
'/': Home,
'/user': User,
'/user/{id}': UserDetail
}
})
@Component({
template,
styles: [style]
})
export class Index implements RouterAction {
child?: any;
canActivate(url: any, module: any): void {
this.child = module;
}
}
constructor(routerManager: RouterManager){
// get path data
routerManager.activeRouterModule.pathData.id; // /user/:id
}
<route component="this.child"></route>
<a router-link="/home" router-active-class="active" router-inactive-class="inactive">home</a>
@Sim({scheme: 'i18nScript'})
@Script({
name: 'i18n'
})
export class I18nScript extends ScriptRunnable {
public language?: Language;
constructor(public i18nService: I18nService) {
super();
i18nService.subject.subscribe(it => {
this.language = it;
this.render(); // <-- ref target rerender
})
}
run(key: string): any {
return this.language?.defaultData?.[key] ?? key;
}
}
counstructor(i18nScript: I18nScript) {...}
counstructor(scriptService: ScriptService) {
const i18nScript = scriptService.getScript('i18n');
}
<div>${$scripts.i18n('Get Locale JSON')}</div>
<div dr-if="$scripts.i18n('Get Locale JSON') === 'wow'"> is wow</div>
Methods that you run for a separate initialization operation after the object is created
@PostConstruct
post(projectService: ProjectService) {
console.log('post Construct and dependency injection')
}
fire($event: MouseEvent, view: View<Element>) {
console.log('fire method')
this.data = RandomUtils.random(0, 100);
}
@Before({property: 'fire'})
before(obj: any, protoType: Function) {
console.log('before', obj, protoType)
}
@After({property: 'fire'})
after(obj: any, protoType: Function) {
console.log('after', obj, protoType)
}
@ExceptionHandler(TypeError)
public exceptionTypeError(e: TypeError) {
console.log('TypeError exception:')
}
@ExceptionHandler(SimError)
public exception1(e: SimError) {
console.log('SimError exception:')
}
@ExceptionHandler(RouterError)
public exception3(e: RouterError) {
console.log('NotFountRoute exception:')
}
@ExceptionHandler(SimNoSuch)
public exception2(e: SimNoSuch) {
console.log('NoSuchSim exception:')
}
FAQs
front end SPA frameworks
The npm package simple-boot-front receives a total of 9 weekly downloads. As such, simple-boot-front popularity was classified as not popular.
We found that simple-boot-front 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.